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.
Placing Orders on Session Open [SOLVED]
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
Why won't it get sent on the first bar at 1700?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.
::
What does the log say?
Do you have your broker side setting to accept after hour orders?
-
- Posts: 12
- Joined: Jan 09 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.
-
- Posts: 12
- Joined: Jan 09 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.
all positions close EOD so something like this if it works would not affect other positions.
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;
- Andrew MultiCharts
- Posts: 1587
- Joined: Oct 11 2011
- Has thanked: 931 times
- Been thanked: 559 times
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.
As we discussed it in the live chat, it is possible with the help of IOG mode and RecalcLastBarAfter keyword in your code.