hi all,
I'm trying to learn how to code, but I faced a problem now.
I tried to incorporate the EMA_Angle indicator into an EA as a filter. My code below works when I just go long if maAngle > EntryAngle_Threshold and short when maAngle < -EntryAngle_Threshold.
However, I want the EA to take only long entrys even if maAngle IS NOT > EntryAngle_Threshold but the last signal from the Indicator was long. I can't really explain any better what I mean, since i don't speak English very well.
For that reason I've attached a picture, which hopefully makes it clear.
Between line 1 and 2, I want the EA to only take short entrys and between 2 and 3 to only take long entrys.
I hope somebody can help me with this.
I'm trying to learn how to code, but I faced a problem now.
I tried to incorporate the EMA_Angle indicator into an EA as a filter. My code below works when I just go long if maAngle > EntryAngle_Threshold and short when maAngle < -EntryAngle_Threshold.
Inserted Code
int ema()
{
double maAngle;
GetMAs(MA_Type, MA_Period , PrevMAShift, CurMAShift);
maAngle = mFactor * (MACurrent - MAPrevious)/2.0;
if (maAngle > EntryAngle_Threshold)return(1);
if (maAngle < -EntryAngle_Threshold)return(2);
} For that reason I've attached a picture, which hopefully makes it clear.
Between line 1 and 2, I want the EA to only take short entrys and between 2 and 3 to only take long entrys.
I hope somebody can help me with this.