Hi I am stuck on a small detail with my backtest script, all of the Entry syntax works well, and the Strategy.doSell script works well as well, but the doCover, doesn't happen, is there anything glaringly obvious here:
//Strategy starts here -->>
if (vEnterLongTrade == true && vTrendMku == nCntr){
Strategy.doLong("Enter Long", Strategy.CLOSE, Strategy.THISBAR);
}
if (vExitLongTrade == true && vTrendMku != nCntr && high() >= vTradeTarget){
Strategy.doSell("Success Long", Strategy.LIMIT, Strategy.THISBAR, null, vTradeTarget);
}
if (vExitLongTrade == true && vTrendMku != nCntr && low() <= vStopLoss){
Strategy.doSell("Fail Long", Strategy.STOP, Strategy.THISBAR, null, vStopLoss);
}
if (vEnterShortTrade == true && vTrendMkd == nCntr){
Strategy.doShort("Enter Short", Strategy.CLOSE, Strategy.THISBAR);
}
if (vExitShortTrade == true && vTrendMkd != nCntr && low() <= vTradeTarget){
Strategy.doCover("Success Short", Strategy.LIMIT, Strategy.THISBAR, null, vTradeTarget);
}
if (vExitShortTrade == true && vTrendMkd != nCntr && high() >= vStopLoss){
Strategy.doCover("Fail Short", Strategy.STOP, Strategy.THISBAR, null, vStopLoss);
}
//Strategy ends here -->>
//Strategy starts here -->>
if (vEnterLongTrade == true && vTrendMku == nCntr){
Strategy.doLong("Enter Long", Strategy.CLOSE, Strategy.THISBAR);
}
if (vExitLongTrade == true && vTrendMku != nCntr && high() >= vTradeTarget){
Strategy.doSell("Success Long", Strategy.LIMIT, Strategy.THISBAR, null, vTradeTarget);
}
if (vExitLongTrade == true && vTrendMku != nCntr && low() <= vStopLoss){
Strategy.doSell("Fail Long", Strategy.STOP, Strategy.THISBAR, null, vStopLoss);
}
if (vEnterShortTrade == true && vTrendMkd == nCntr){
Strategy.doShort("Enter Short", Strategy.CLOSE, Strategy.THISBAR);
}
if (vExitShortTrade == true && vTrendMkd != nCntr && low() <= vTradeTarget){
Strategy.doCover("Success Short", Strategy.LIMIT, Strategy.THISBAR, null, vTradeTarget);
}
if (vExitShortTrade == true && vTrendMkd != nCntr && high() >= vStopLoss){
Strategy.doCover("Fail Short", Strategy.STOP, Strategy.THISBAR, null, vStopLoss);
}
//Strategy ends here -->>
Comment