Hello everybody.
How during backtesting I can discover that the test position for strategy on the chart has changed? For instance, in real time trading come OnBrokerPositionChange() event. Is there some similar event for backtesting positions? Or how I can to know, that test order was executed?
Thanks.
How to know, that test position was changed.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: How to know, that test position was changed.
During a position change in backtesting, `StrategyInfo.MarketPosition` and/or `CurrentPosition.OpenLots` will change.
If you store the value of these in variables, and compare the current value with the variables on each calculation, you can see whether or not these have changed.
Alternatively, I think this also can be done with `Positions[x]`.
If you store the value of these in variables, and compare the current value with the variables on each calculation, you can see whether or not these have changed.
Alternatively, I think this also can be done with `Positions[x]`.
Re: How to know, that test position was changed.
I already using similar method, but I thought exist standard event or decision.If you store the value of these in variables, and compare the current value with the variables on each calculation, you can see whether or not these have changed.
Alternatively, I think this also can be done with `Positions[x]`.