is there a way to get a given variable to be assigned ONLY WHEN fired orders are actually executed?
with a code like this:
if (PublicFunctions.DoubleGreater(Bars.High[0], Bars.High[1])){
variable = true;
buy_order.Send(Bars.High[1],Bars.High[1],pos_size);
}
when condition is true the order is fired and the variable is assigned to true.
But it may happen that the order is not executed at the end and in this case I would like not to have the variable assigned.
How can I do this?
Thank you
Variable assignment only after actual execution of the order
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Variable assignment only after actual execution of the o
Hello tesiag,
That is possible to assign the variable only after the actual position for the instrument changes.
Please check OnBrokerPositionChange, OnBrokerStategyOrderFilled
That is possible to assign the variable only after the actual position for the instrument changes.
Please check OnBrokerPositionChange, OnBrokerStategyOrderFilled