Reply

Plot D1 EMA20 on H4 Chart

1 replies

alvin

Customer, bbp_participant, community, 10 replies.

Visit profile

6 years ago #113551

Hi,

 

How can I plot a D1 EMA20 indicator on H4 Chart?

 

Thanks.

0

alvin

Customer, bbp_participant, community, 10 replies.

Visit profile

6 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.

0

Viewing 2 posts - 1 through 2 (of 2 total)