Order to exit market  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Order to exit market

Postby orad » 22 Jan 2015

Hi,

Is there an order type to exit all positions on bar close? Or do I need to always check current positions at the broker and send the appropriate exit (LX or SX) orders?

The name of the special order GenerateExitOnClose() is confusing as it does not denote that it is order to exit on session close. I think it should be named as GenerateExitOnSessionClose(). I'm looking for a GenerateExitOnBarClose() order or GenerateExit() for immediate exit.

My other question is, on the Orders page in the programmer's guide, the description for exitInfo parameter of SOrderParameters is not very clear. Does the exitInfo indicate contracts to be exited before this order is taken place or is it the exit strategy of the order being created?

Also, from the description:
OrderExit:
FromAll – closes all entries, which opened the position. If the quantity of contracts is specified, then close each entry partially on the quantity of contracts specified.
Total – closes the position on ONLY the specified quantity of contracts. The entries will be closed accordingly, starting from the first one, up to the last one, until the exit is executed upon the quantity of contracts specified.
If the quantity of contracts is specified, then will OrderExit.FromAll and OrderExit.Total be the same?


Thanks!
Last edited by orad on 14 May 2017, edited 1 time in total.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Order to exit market

Postby Henry MultiСharts » 26 Jan 2015

Is there an order type to exit all positions on bar close? Or do I need to always check current positions at the broker and send the appropriate exit (LX or SX) orders?

I'm looking for a GenerateExitOnBarClose() order or GenerateExit() for immediate exit.
There is no such prebuilt order type.
My other question is, on the Orders page in the programmer's guide, the description for exitInfo parameter of SOrderParameters is not very clear. Does the exitInfo indicate contracts to be exited before this order is taken place or is it the exist strategy of the order being created?
This is an order constructor parameter. It specifies the type of exit order.
Also, from the description:
OrderExit:
FromAll – closes all entries, which opened the position. If the quantity of contracts is specified, then close each entry partially on the quantity of contracts specified.
Total – closes the position on ONLY the specified quantity of contracts. The entries will be closed accordingly, starting from the first one, up to the last one, until the exit is executed upon the quantity of contracts specified.
If the quantity of contracts is specified, then will OrderExit.FromAll and OrderExit.Total be the same?
It will be the same if there is a single entry order for this position.

User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Re: Order to exit market

Postby orad » 26 Jan 2015

Hi,

Just made a feature request (MC-1844) for adding Special Orders to generate Exit at bar close and immediately at the call.
the description for exitInfo parameter of SOrderParameters is not very clear. Does the exitInfo indicate contracts to be exited before this order is taken place or is it the exist strategy of the order being created?
This is an order constructor parameter.
It specifies the type of exit order.
I understand exitInfo is a constructor parameter for creating orders. But why is this available for all orders? What I don't understand is when creating an entry price order/market order what does exit info apply to? Or is it ignored?
Last edited by orad on 14 May 2017, edited 2 times in total.

User avatar
orad
Posts: 121
Joined: 14 Nov 2012
Has thanked: 50 times
Been thanked: 20 times

Re: Order to exit market

Postby orad » 29 Jan 2015

I modified my question in last post to sound less confused. Basically, is exit order info ignored for entry orders (even though the API allows entering them)?!

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Order to exit market  [SOLVED]

Postby Henry MultiСharts » 30 Jan 2015

I understand exitInfo is a constructor parameter for creating orders. But why does this available for all orders? What I don't understand is when creating an entry price order/market order what does exit info apply to? Or is it ignored?
exitInfo is applied to exit orders only.


Return to “MultiCharts .NET”