When I open a new chart window and "APPLY " the following 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 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("trade rules");
Buy=Cross(MACD(), Signal());
Sell=Cross(Signal(), MACD());
Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);
_SECTION_END();
Filter = 1; // show all bars
cond1=Cross(MACD(), Signal());
cond2= Cross(Signal(), MACD());
bi = BarIndex();
//
AddColumn( C, "Close" );
AddColumn( bi, "BarIndex" );
AddColumn( cond1, "MACDup",1,colorDefault,IIf(cond1,colorGreen,colorDefault));
AddColumn( ValueWhen( cond1, bi ), "ValueWhen( cond1, BarIndex() )" );
AddColumn( ValueWhen( cond1, Close), "ValueWhen( cond1, Close )" );
AddColumn( ValueWhen( cond2, bi ), "ValueWhen( cond2, BarIndex() )" );
AddColumn( cond2, "SIGNALup",1,colorDefault,IIf(cond2,colorRed,colorDefault));
AddColumn( ValueWhen( cond2, Close), "ValueWhen( cond2, Close )" );
addColumn( MACD(), "MACD", 1.4 , IIf( MACD() > Signal(), colorGreen, colorRed ) );
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
Plot( Close, "Price", colorBlack, styleCandle );
PlotShapes( shape, IIf( Buy, colorBlue, colorYellow ), 0, IIf( Buy, Low, High ) );
GraphXSpace = 5;
I get the Blue and yellow arrows correctly matched to the MACD. And then when I right click in the chart pane select EDIT then select analysis > backtest > right click and show arrows for actual trades I get Green ( buy) and red (sell ) arrows correctly matched to the MACD and the blue and yellow arrows are not visible.
Copy the above formula into a clean editor and apply, then from that chart window do as above and run backtest etc.