I would like some help about the exit from a position.
For example I have a script, the OnBarUpdate() consist of an EnterLong(), and next row a stoploss, with SetStopLoss(). In the next end of bar the OnBarUpdate() will be calling. In the case,when the price reached the stop loss price, how will be handling the exit. Where is the moment, when the position will be terminated? First run the whole OnBarUpdate() with all commands written by my own, and then will terminated the position, or the position will be terminated without running OnBarUpdate().
May be that my problem will be more comprehensible if you see my job: I would like to print the cause of the terminating of the position. (The price reached the stop loss, or there was a forced terminating with ExitShort(), or ExitLong(), or the end of the day).
Where can I found any kind of material about this issue?
Best regard
Akos
Comment