I have a concern re: the validity of my results from backtesting. I understand that only completed bars may be used (in backtesting), thus Strategy.MARKET = bar open, and Strategy.CLOSE = bar close.
Is it possible to perform math operations on these 'types', i.e.
var realLongFill = ((Strategy.CLOSE) - (Strategy.MARKET))/2 - Just as a better approximation, and then:
setLimit(realLongFill);
and then using Strategy.LIMIT for fill type?
I've coded the above, and get no syntax errors, but I also don't get filled...
In a nutshell, how can we get more realistic fills in the backtesting environment? Hopefully I'm missing something obvious here... Thanks for the help!!
Is it possible to perform math operations on these 'types', i.e.
var realLongFill = ((Strategy.CLOSE) - (Strategy.MARKET))/2 - Just as a better approximation, and then:
setLimit(realLongFill);
and then using Strategy.LIMIT for fill type?
I've coded the above, and get no syntax errors, but I also don't get filled...
In a nutshell, how can we get more realistic fills in the backtesting environment? Hopefully I'm missing something obvious here... Thanks for the help!!
Comment