Why is it that hiding take profit and stop loss using OrderClose() gives different results, when compared to using OrderModify() ?
- Requests & Ideas
- OrderModify
- What's wrong with OrderClose()
Why is it that hiding take profit and stop loss using OrderClose() gives different results, when compared to using OrderModify() ?
Because your code is broken or you are not considering that spread is different between tests.
Spread isn't different between tests because I use Birt's Tick Data Suite to use all ticks with their real variable spread for each tick. 99% modeling quality.
So the only option left is that my code is broken. I made 40% profit after doing 59 trades since 8th Jan using the OrderModify() version which reveals my stops and take profits in the order book. And so I am sure this means there error lies in the part which hides the stops and take profits.
Is it possible that OrderClose() runs on a separate thread, and has random delays added to it, so by the time OrderClose() actually works, the Strategy Tester has moved on to other ticks at high speed?
Spread isn't different between tests because I use Birt's Tick Data Suite to use all ticks with their real variable spread for each tick. 99% modeling quality.
So the only option left is that my code is broken. I made 40% profit after doing 59 trades since 8th Jan using the OrderModify() version which reveals my stops and take profits in the order book. And so I am sure this means there error lies in the part which hides the stops and take profits.
Is it possible that OrderClose() runs on a separate thread, and has random delays added to it, so by the time OrderClose() actually works, the Strategy Tester has moved on to other ticks at high speed?
We have to close the trades with OrderClosePrice() if we are using hidden levels for broker
That can be the trade get closed at Ask or Bid depends on Type
If you store those prices and then compare it with the price of the trade then the spread is calculated if you compare it with right stored price
Spread isn't different between tests because I use Birt's Tick Data Suite to use all ticks with their real variable spread for each tick. 99% modeling quality.
So the only option left is that my code is broken. I made 40% profit after doing 59 trades since 8th Jan using the OrderModify() version which reveals my stops and take profits in the order book. And so I am sure this means there error lies in the part which hides the stops and take profits.
Is it possible that OrderClose() runs on a separate thread, and has random delays added to it, so by the time OrderClose() actually works, the Strategy Tester has moved on to other ticks at high speed?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use