Wrote a simple code for back testing.
Though in scan mode, the code execution returns results, even we can see the signals drawn on the chart.
But while back testing, there is no result shown
a) when I ran as “Portfolio”.
b) when I ran as “Individual”, all the symbols are listed, except symbol name – everything is either blank or zero.
Even the report is showing no trade.
I am giving the code and the screenshots.
_SECTION_BEGIN("EMAXOVER");
SetChartOptions(0,chartShowArrows|chartShowDates);
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
ema20=EMA(C,20);
ema50=EMA(C,50);
Plot(ema20,"ema20",colorGreen,styleLine);
Plot(ema50,"ema50",colorred,styleLine);
//Buy Sell logic
Buy=Cross(ema20,ema50);
sell=Cross(ema50,ema20);
/* Plot Buy and Sell Signal Arrows */
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
//Buy sell price
BuyPrice=Close;
SellPrice=Close;
// Margin info
PositionSize=1000000;
SetTradeDelays(0,0,0,0);
_SECTION_END();