Multiple Timeframe ROC optimize buy-sell signals

#1
Hi Guys,
I want to optimize a multiple timeframe ROC and put buy-sell signals on the chart but i cant put buy-sell arrows on chart.. What am i doing wrong? Anyone can help? Code optimize the sub-timeframe as 5xminutes and ROC value..
Here is the code..



_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
_SECTION_END();

_SECTION_BEGIN("ROC");
SetBarsRequired(10000,10000);

time=Optimize("time",12,12,12,12);
n = Optimize("n",56,1,100,1); // ROC value

TimeFrameSet(time * in5Minute );
Rocco= ROC(C,n);


TimeFrameRestore();
Roccom = TimeFrameExpand(Rocco, time * in5Minute, expandFirst);


Buy1= Ref(Rocco,-1) > 0;
sell1= Ref(Rocco,-1) < 0;

Buy = buy1;
Sell = sell1;

Short = Sell;
Cover = Buy;

Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Plot( Roccom, "ROC in minutes", colorRed );

// plot arrows
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );
_SECTION_END();
 

Similar threads