Plot D1 EMA20 on H4 Chart
1 replies
alvin
9 years ago #113551
alvin
9 years ago #129693
Hi,
As we don’t have a plot EMA function in SQ EA Wizard, I just try to make an indicator.
Basically I want to have up arrow indicator when D1 EMA 20 > D1 EMA 50 for 3 periods and last close price > M30 EMA 50.
Also, I want to have down arrow indicator when D1 EMA 20 < D1 EMA 50 for 3 periods and last close price < M30 EMA 50.
I attach the indicator to M30 chart but it disregards the D1 periods, and calculates the EMA based on M30 chart and plot the indicators on M30 chart.
The following is the pseudo-code generated.
// Rule 1 IF (IsBarOpen is True) && (((((EMA( PERIOD_D1 , 20 , Close )[3] < EMA( PERIOD_D1 , 50 , Close )[3]) And (EMA( PERIOD_D1 , 20 , Close )[2] < EMA( PERIOD_D1 , 50 , Close )[2])) And (EMA( PERIOD_D1 , 20 , Close )[1] < EMA( PERIOD_D1 , 50 , Close )[1])) And (Close[1] EMA( PERIOD_D1 , 50 , Close )[3]) And (EMA( PERIOD_D1 , 20 , Close )[2] > EMA( PERIOD_D1 , 50 , Close )[2])) And (EMA( PERIOD_D1 , 20 , Close )[1] > EMA( PERIOD_D1 , 50 , Close )[1])) And (Close[1] > EMA( PERIOD_M30 , 50 , Close )[1]))) THEN Draw Up Arrow; END IF;
Please help.
Viewing 1 replies (of 1 total)