Hi all,
I use 5 min chart and want to add buy arrows to my chart which satisfy conditions involving two time frames, as under:
1) Price crosses moving average line, on the upside.in 5 min chart
2) CCI indicator is less than -50 in 30 min chart.
I tried to make an indicator, but it is not giving the correct result. While buy arrows are shown, they are not remaining constant at the same place, They keep changing.
I give below the code : (My base chart is 5 minutes)
TimeFrameSet( 1800); //Timeframe set to 30 minutes
CCI30Min = CCI (20); // Calculation of 20 periods CCI value in 30 min time frame
TimeFrameRestore( );
AveragePrice = MA(Close, 50);
Buy = Cross(Close, AveragePrice) AND CCI30Min < -50 * shapeUpArrow ;
Plot(C, "Price", colorBrightGreen, styleCandle) ; // price plot
PlotShapes(Buy, colorYellow, 0, Low, -10); // buy arrow plot
Can somebody be kind enough to correct the mistake in the above codes.
Thanks for your time.
Regards
perumal