What am I doing? : Trying to see the back-test results of my strategy.
What is going on? : I have coded the EFS to paint the background with a particular color for each Long and Short trades. Applying the EFS on the chart shows the trades and I able to visually see the logic working absolutely fine.
What is the problem? : The moment I click "Show Backtest Results" ESignal crashes.
What is causing the problem? : Two particular lines in my code (One line in the Short Entry Logic other in the Long entry logic). I have pasted the part of the code below which handles the Short entry logic.
.
.
.
nCandle_Count++; // Counts the number of candles since the last position has been taken or position has been closed
// Short Entry Signal
var bShort_1 = xxxxxxxxxx //( Cant share the logic, but what all it does is,being a boolean variable generates either a True or False)
if(bShort_1 == true){ // this part of code decides whether to go short or just cut my already long position based on 'nCandle_Count' compared to nCandle_Count_Threshold
if(Strategy.isLong()==true && nCandle_Count < nCandle_Count_Threshold){
Strategy.doSell("Long Threshold close",Strategy.MARKET,Strategy.THISBAR); // This is the line which is crashing Esignal. When I disable this line by commenting it out, i am able to see backtest results but my logic is getting affected
nCandle_Count=1;
}
if(Strategy.isShort() == false && nCandle_Count >=nCandle_Count_Threshold){
Strategy.doShort("Short Signal",Strategy.MARKET,Strategy.THISBAR);
nCandle_Count=1;
}
Why is this happening ? : I DONT KNOW, Can somebody help ?
What is going on? : I have coded the EFS to paint the background with a particular color for each Long and Short trades. Applying the EFS on the chart shows the trades and I able to visually see the logic working absolutely fine.
What is the problem? : The moment I click "Show Backtest Results" ESignal crashes.
What is causing the problem? : Two particular lines in my code (One line in the Short Entry Logic other in the Long entry logic). I have pasted the part of the code below which handles the Short entry logic.
.
.
.
nCandle_Count++; // Counts the number of candles since the last position has been taken or position has been closed
// Short Entry Signal
var bShort_1 = xxxxxxxxxx //( Cant share the logic, but what all it does is,being a boolean variable generates either a True or False)
if(bShort_1 == true){ // this part of code decides whether to go short or just cut my already long position based on 'nCandle_Count' compared to nCandle_Count_Threshold
if(Strategy.isLong()==true && nCandle_Count < nCandle_Count_Threshold){
Strategy.doSell("Long Threshold close",Strategy.MARKET,Strategy.THISBAR); // This is the line which is crashing Esignal. When I disable this line by commenting it out, i am able to see backtest results but my logic is getting affected
nCandle_Count=1;
}
if(Strategy.isShort() == false && nCandle_Count >=nCandle_Count_Threshold){
Strategy.doShort("Short Signal",Strategy.MARKET,Strategy.THISBAR);
nCandle_Count=1;
}
Why is this happening ? : I DONT KNOW, Can somebody help ?
Comment