Hi All,
Currently, I am backtesting a strategy, and making sure I get realistic fills for further research. But I ran into a problem that I am not sure how to fix.
Here is a working snippet:
When I try to round the fill price, because it is long, like 34.4635454, here is that code that does NOT work
Debug prints in the nonworking version indicate the price is being rounded correctly. But the backtester isn't recognizing them as fills! Strange stuff, please help! XD
- Roger
Currently, I am backtesting a strategy, and making sure I get realistic fills for further research. But I ran into a problem that I am not sure how to fix.
Here is a working snippet:
PHP Code:
nPosPrice = nLowerEnvelopeLast;
Strategy.doLong("Long",Strategy.LIMIT,Strategy.THISBAR,100,nPosPrice)
PHP Code:
nPosPrice = nLowerEnvelopeLast.toFixed(2);
Strategy.doLong("Long",Strategy.LIMIT,Strategy.THISBAR,100,nPosPrice)
- Roger
Comment