Back-testing on ieod data

Hiii,

I am trying to backtest the below strategy on IEOD 15 min chart but unable to get any result.

Please help.
_SECTION_BEGIN("Narrow Range Strategy");

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 ) ) ));

//Initial Parameters
SetPositionSize(1*RoundLotSize,spsShares);
Plot( Close, "Price", colorWhite, styleCandle );

//==================================================================================
//NARROW RANGE PIVOT IDENTIFICATION

PrevDay = 0; // Value should be 1 if your database is updated upto current day

PrevHigh = TimeFrameGetPrice("H", inDaily, -1);
PrevLow = TimeFrameGetPrice("L", inDaily, -1);
PrevClose = TimeFrameGetPrice("C", inDaily, -1);

Pivot = (PrevLow+PrevHigh+PrevClose)/3;
BC = (PrevLow+PrevHigh)/2;
TC = (Pivot-BC) + Pivot;

NRThreshold = 0.2;
NarrowRangeCond = (abs(TC-BC)/PrevClose*100) < NRThreshold;
NarrowRange = WriteIf(NarrowRangeCond,"YES","NO");

// Daily Camarilla

DH5 = (PrevHigh/PrevLow) * PrevClose ;
DH4 = PrevClose + (PrevHigh- PrevLow) * 1.1 / 2.0;
DH3 = PrevClose + (PrevHigh- PrevLow) * 1.1 / 4.0;
DL3 = PrevClose - (PrevHigh- PrevLow) * 1.1 / 4.0;
DL4 = PrevClose - (PrevHigh- PrevLow) * 1.1 / 2.0;
DL5 = PrevClose - (DH5 - PrevClose );

Plot(Pivot, "DPV",colorAqua,styleLine);
Plot(TC, "DTC",colorAqua,styleLine);
Plot(BC, "DBC",colorAqua,styleLine);

Plot(DH5, "DH5",colorBlue,styleLine);
Plot(DH4, "DH4",colorYellow,styleLine);
Plot(DH3, "DH3",colorRed,styleLine);
Plot(DL3, "DL3",colorGreen,styleLine);
Plot(DL4, "DL4",colorYellow,styleLine);
Plot(DL5, "DL5",colorBlue,styleLine);

//BuyPrice=Open;
//SellPrice=Open;
//ShortPrice=Open;
//CoverPrice=Open;

dn = DateNum();
newDay = dn != Ref( dn,-1);

TargetPrice = Param("Target Points",30,1,500,1);
StopPrice = Param("Stop Points",20,1,500,1);

Buy=Cross(C,DH4);
//Short=NarrowRangeCond AND (DH3<1.001Pivot AND DH3>0.999Pivot)AND Cross(C,DL4);;

BuyPrice = ValueWhen(Buy,Close);

TargetBuy = BuyPrice + TargetPrice;
StopBuy = BuyPrice - StopPrice;

Sell = Cross(H,TargetBuy) OR Cross(StopBuy,L); //Exit if Target/Stop/Square off Time reached

SellPrice = IIf(Cross(H,TargetBuy), TargetBuy, IIf(Cross(StopBuy,L), StopBuy, Close));

Buy = ExRem(Buy,Sell);
Sell =ExRem(Sell,Buy);
BuyCont = Flip(Buy,Sell);
SellCont = Flip(Sell,Buy);

printf("\nBuy : " + Buy );
printf("\nSell : " + Sell );
//printf("\nShort : " + Short );
//printf("\nCover : " + Cover );
printf("\nBuyPrice : " + BuyPrice );
//printf("\nShortPrice : " + ShortPrice );
printf("\nSellPrice : " + SellPrice );
//printf("\nCoverPrice : " + CoverPrice );
printf("\nBuyTgt : " + TargetBuy );
printf("\nBuySL : " + StopBuy );
//printf("\nShortTgt : " + ShortTgt );
//printf("\nShortSL : " + ShortSL );

/* 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(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
//PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
//PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Sell, shapeStar, shapeNone),colorWhite, 0, H, Offset=25);
//PlotShapes(IIf(Cover, shapeStar, shapeNone),colorWhite, 0,L, Offset=-25);

_SECTION_END();

_SECTION_BEGIN("Narrow Range Strategy");

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 ) ) ));

//Initial Parameters
SetPositionSize(1*RoundLotSize,spsShares);
Plot( Close, "Price", colorWhite, styleCandle );

//==================================================================================
//NARROW RANGE PIVOT IDENTIFICATION

PrevDay = 0; // Value should be 1 if your database is updated upto current day

PrevHigh =  TimeFrameGetPrice("H", inDaily, -1);    
PrevLow =  TimeFrameGetPrice("L", inDaily, -1);
PrevClose =  TimeFrameGetPrice("C", inDaily, -1);

Pivot = (PrevLow+PrevHigh+PrevClose)/3;
BC = (PrevLow+PrevHigh)/2;
TC = (Pivot-BC) + Pivot;

NRThreshold = 0.2;
NarrowRangeCond = (abs(TC-BC)/PrevClose*100) < NRThreshold;
NarrowRange = WriteIf(NarrowRangeCond,"YES","NO");
 

// Daily Camarilla

DH5 = (PrevHigh/PrevLow) * PrevClose ;
DH4 = PrevClose + (PrevHigh- PrevLow) * 1.1 / 2.0;
DH3 = PrevClose + (PrevHigh- PrevLow) * 1.1 / 4.0;
DL3 = PrevClose - (PrevHigh- PrevLow) * 1.1 / 4.0;
DL4 = PrevClose - (PrevHigh- PrevLow) * 1.1 / 2.0;
DL5 = PrevClose - (DH5 - PrevClose );

Plot(Pivot, "DPV",colorAqua,styleLine);
Plot(TC, "DTC",colorAqua,styleLine);
Plot(BC, "DBC",colorAqua,styleLine);

Plot(DH5, "DH5",colorBlue,styleLine);
Plot(DH4, "DH4",colorYellow,styleLine);
Plot(DH3, "DH3",colorRed,styleLine);
Plot(DL3, "DL3",colorGreen,styleLine);
Plot(DL4, "DL4",colorYellow,styleLine);
Plot(DL5, "DL5",colorBlue,styleLine);

//BuyPrice=Open;
//SellPrice=Open;
//ShortPrice=Open;
//CoverPrice=Open;

dn = DateNum();
newDay = dn != Ref( dn,-1);

TargetPrice = Param("Target Points",30,1,500,1);
StopPrice = Param("Stop Points",20,1,500,1);

Buy=Cross(C,DH4);
//Short=NarrowRangeCond AND (DH3<1.001*Pivot AND DH3>0.999*Pivot)AND Cross(C,DL4);;

BuyPrice = ValueWhen(Buy,Close);

TargetBuy = BuyPrice + TargetPrice;
StopBuy = BuyPrice - StopPrice;

Sell = Cross(H,TargetBuy) OR Cross(StopBuy,L); //Exit if Target/Stop/Square off Time reached

SellPrice = IIf(Cross(H,TargetBuy), TargetBuy, IIf(Cross(StopBuy,L), StopBuy, Close));


Buy = ExRem(Buy,Sell);
Sell =ExRem(Sell,Buy);
BuyCont = Flip(Buy,Sell);
SellCont = Flip(Sell,Buy);


printf("\nBuy : " + Buy );   
printf("\nSell : " + Sell );  
//printf("\nShort : " + Short );  
//printf("\nCover : " + Cover );  
printf("\nBuyPrice : " + BuyPrice );
//printf("\nShortPrice : " + ShortPrice ); 
printf("\nSellPrice : " + SellPrice ); 
//printf("\nCoverPrice : " + CoverPrice ); 
printf("\nBuyTgt : " + TargetBuy );  
printf("\nBuySL : " + StopBuy ); 
//printf("\nShortTgt : " + ShortTgt );  
//printf("\nShortSL : " + ShortSL ); 


/* 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(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
//PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
//PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
PlotShapes(IIf(Sell, shapeStar, shapeNone),colorWhite, 0, H, Offset=25);
//PlotShapes(IIf(Cover, shapeStar, shapeNone),colorWhite, 0,L, Offset=-25);

_SECTION_END();

@hrsw57, thanks for figuring out that you need to use the code tags to post.

You also need to get your "Verified Badge" to post questions. Just use the Search (magnifying glass up by your profile) to find the discussion and instructions.

Once verified, you should check out this post: How do I debug my formula?