Hi
I have a scenario where I have an IOPriced order creating a limit order - like below.
if ((Bars.Close[0] < X)
{
m_LongStop
.Send(Bars.Close[0] - padAmount,
Convert.ToInt32(CurrentPosition.OpenLots * percent) );
}
Is there a way to know if this order executed successfully and then not execute this line of code again until a certain condition is met? Currently I am using position size to determine if an order has executed but it is becoming cumbersome in code where there are multiple exits. MC will close the order if I only expose this order only one time and in the next tick if this code is not hit, it will cancel the order. Does this IOPriced return a int or Bool for keep track of? Appreciate your help
IOrderPriced Order Completion
-
- Posts: 20
- Joined: 03 Dec 2018
Re: IOrderPriced Order Completion
I found a way. But one question is that if an order is executed, I cannot repurpose the same order to reduce a position size, my code works only when there is another order with a different name. The same order will work again after the position size has gone to zero and a new trade was used to open a new position. Is there a way to repurpose the same order again and again and to reduce code complexity.
- Vlada MultiCharts
- Posts: 293
- Joined: 22 Apr 2020
- Has thanked: 8 times
- Been thanked: 76 times
Re: IOrderPriced Order Completion
Hello lordsriram,
If you need assistance from our engineers with the second question, please send us the whole script and describe in more detail what you would like to achieve.
If you need assistance from our engineers with the second question, please send us the whole script and describe in more detail what you would like to achieve.
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
Re: IOrderPriced Order Completion
Hi lordsriram,
this is the default behaviour, which can be changed by using the ExitFromOneEntryOnce attribute.
Regards,
ABC
this is the default behaviour, which can be changed by using the ExitFromOneEntryOnce attribute.
Regards,
ABC