IOrderPriced Order Completion

Questions about MultiCharts .NET and user contributed studies.
lordsriram
Posts: 20
Joined: 03 Dec 2018

IOrderPriced Order Completion

Postby lordsriram » 04 May 2023

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

lordsriram
Posts: 20
Joined: 03 Dec 2018

Re: IOrderPriced Order Completion

Postby lordsriram » 05 May 2023

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.

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: IOrderPriced Order Completion

Postby Vlada MultiCharts » 11 May 2023

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.

User avatar
ABC
Posts: 721
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 409 times
Contact:

Re: IOrderPriced Order Completion

Postby ABC » 12 May 2023

Hi lordsriram,

this is the default behaviour, which can be changed by using the ExitFromOneEntryOnce attribute.

Regards,

ABC


Return to “MultiCharts .NET”