While doing backtest of the following script in amibroker, I get 'missing buy/sell variable assignment' error, though I have assigned buy/sell variables in the script.
************************************************** **************
function isBuyCond()
return (C[BarCount-2] > O[BarCount-2]);
function isSellCond()
return (C[BarCount-2] <= O[BarCount-2]);
if (isSellCond())
Sell = 1;
if (isBuyCond())
Buy = 1;
************************************************** **************
Basically with the above strategy, I am trying to generate buy/sell signals based on the last candle. If candle is green, then set BUY to True; if candle is red, set SELL to true.
Please let me know if I am missing something
************************************************** **************
function isBuyCond()
return (C[BarCount-2] > O[BarCount-2]);
function isSellCond()
return (C[BarCount-2] <= O[BarCount-2]);
if (isSellCond())
Sell = 1;
if (isBuyCond())
Buy = 1;
************************************************** **************
Basically with the above strategy, I am trying to generate buy/sell signals based on the last candle. If candle is green, then set BUY to True; if candle is red, set SELL to true.
Please let me know if I am missing something
Missing buy/sell variable statements during backtest (amibroker)
Aucun commentaire:
Enregistrer un commentaire