Coding for order to be Good til date/time with IB

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Coding for order to be Good til date/time with IB

Postby arjfca » 18 Aug 2011

Hello

I'm sending a stop order to IB. If price reach my target, then execute. On IB site, I read that I could use "Good til date / time"

I want my order to be good only for the duration of the actual bar. I want it to be canceled if not executed by the end of the bar.

Can I code to send the order using Good Til Date/time. All I would need it to calculate to send the ending time of the actual bar.

Martin

User avatar
Stan Bokov
Posts: 963
Joined: 18 Dec 2009
Has thanked: 367 times
Been thanked: 302 times

Re: Coding for order to be Good til date/time with IB

Postby Stan Bokov » 24 Aug 2011

If you would like to make the order active only for this bar and cancelled on the next bar - in your script don't send the order on the next bar. Basically, implement a flag and if the order was sent, don't send it again.

That is the only way how it can be implemented from the MultiCharts side. Time in Force affects the orders from the broker side and it doesn't regulate the condition of sending orders in the MultiCharts.


Return to “MultiCharts”