Bug | Execution of positions on demo
Bug | Execution of positions on demo
29 Jun 2016, 10:09
I have come across a bug when one position closes and this event triggers another position to open, as this does not simulate live trading conditions where the request is sent to broker where there would be a delay and error occurs.
Error description
If a position is closed and another opened on the onClose event, this position closes with a notification, but does not leave the positions tab, after a few seconds it moves, but there is no notification. The image below shows the 2nd position (doublePosition), this should be at the top of the list as the time-stamp is the latest. they should be reversed.
How to reproduce the error
Create an automated cBot where only a single position is ever open at anytime, open a position onStart with a small stop loss and take profit. When the position closes, immediately open a new position with same settings and continue until error occurs.
Note
The error does not occur on back-test, only forward testing, so you will need to run it on demo and not live as demo has no simulated delay of filling orders.
possible asynchronous issue, good luck. :-)
ClickAlgo
29 Jun 2016, 10:20
My mistake, it is ordered by opening time and not closing time. the 2nd position did close, but when it moved from positions to history it updated the closing time to the incorrect value. The error still stands.
@ClickAlgo