Placing Orders on Session Open  [SOLVED]

Questions about MultiCharts and user contributed studies.
joshweaver05
Posts: 12
Joined: 09 Jan 2014

Placing Orders on Session Open

Postby joshweaver05 » 11 Jan 2014

since multicharts does pretty much everything next bar open in real time it seems to be causing me some issues from one session to the next. for example if we have a market like the ES, and it is open from 1700 - 1615, and an order is generated on the last bar of the day at 1615 it won't get sent to the broker and it won't get sent on the first bar at 1700 either. I have looked around to find similar post but could not find anything. if any one could give me suggestions on what to do or a link please do so. I am just looking for a way to get that order out at 1700.

the only possible solution i could come up with was IOG, hoping there is a better once since IOG has terrible performance in MC.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Placing Orders on Session Open

Postby TJ » 11 Jan 2014

since multicharts does pretty much everything next bar open in real time it seems to be causing me some issues from one session to the next. for example if we have a market like the ES, and it is open from 1700 - 1615, and an order is generated on the last bar of the day at 1615 it won't get sent to the broker and it won't get sent on the first bar at 1700 either.
::
Why won't it get sent on the first bar at 1700?
What does the log say?

Do you have your broker side setting to accept after hour orders?

joshweaver05
Posts: 12
Joined: 09 Jan 2014

Re: Placing Orders on Session Open

Postby joshweaver05 » 11 Jan 2014

there are no after hour orders on the CME, unless your broker holds the order. the issue is at 1615 the order is placed ment for 1700 hour but but gets rejected so when 1700 comes around there are no order. it won't send new order till 1705 ( 5 min bars) since it thought it already send the 1700 bar order.

joshweaver05
Posts: 12
Joined: 09 Jan 2014

Re: Placing Orders on Session Open

Postby joshweaver05 » 12 Jan 2014

was thinking of ideas and thought this might be a way around it, what do you think? its not complete code just quick jot to kinda get the idea on paper.

Code: Select all

if currenttime = 1710 then begin //current time = first bar for session
Recalculate;
end;

if MarketPosition_at_Broker <> Marketposition then begin
if Marketposition = 1 then buy this bar close;
if Marketposition = -1 then sellshort this bar close;
end;
all positions close EOD so something like this if it works would not affect other positions.

User avatar
Andrew MultiCharts
Posts: 1587
Joined: 11 Oct 2011
Has thanked: 931 times
Been thanked: 559 times

Re: Placing Orders on Session Open  [SOLVED]

Postby Andrew MultiCharts » 13 Jan 2014

Hello Josh,

As we discussed it in the live chat, it is possible with the help of IOG mode and RecalcLastBarAfter keyword in your code.


Return to “MultiCharts”