Interday automation

Questions about MultiCharts and user contributed studies.
Posts: 154
Joined: 07 Apr 2007

Interday automation

Postby brendanh » 25 Sep 2009

I use forex minute charts and hold positions interday. I don't use 24h sessions. At the end of a session, if there is an order at IB, it will not be cancelled, so if there is an overnight move, IB will wrongly fill during the night. MC should automate as per my system, ie fill at the price the chart fills at open the next day.

If I manually cancel the IB orders at end of day, MC won't recreate the broker orders at first bar the next day, and so there is chart\broker position disconnect.

So there are two issues here. At end of session, MC should cancel broker orders created by the chart. And secondly, recreate broker orders from the end of the previous day (previous bar) at start of the next day session (at start of first bar otherwise there will be chart\broker disconnect).

Many thanks and keep up the good work.

User avatar
Andrew Kirillov
Posts: 1589
Joined: 28 Jul 2005
Has thanked: 2 times
Been thanked: 31 times

Postby Andrew Kirillov » 28 Sep 2009


You should improve your script so it will consider the Sessions settings.

Posts: 154
Joined: 07 Apr 2007

Postby brendanh » 28 Sep 2009

Please advise how I can program my script to cancel all IB orders at the end of the session while still ensuring these orders are filled the next day. There is no MC command to cancel IB orders. And anyway, if I do (I have tried manually cancelling them) they aren't filled at start of day instead.

MC should automate as per my system. Ie. fill when it fills on chart, not in gaps during the night. At end of session, MC should cancel orders generated by the chart, and replace them at start of next session.

TS is able to automate the same code fine. Orders that are filled on first bar of the day in TS are filled during the night in MC\IB. This is inaccurate strategy automation.

Posts: 627
Joined: 03 Mar 2007
Has thanked: 101 times
Been thanked: 80 times

Postby SUPER » 28 Sep 2009


wondering if something like this will work for you?

Input: Starttime(0800), EndTime(2200);

Condition1=time>=Starttime and Time <=EndTime;

If Condition1 then begin

My Buy conditions
My Sell conditions


Posts: 154
Joined: 07 Apr 2007

Postby brendanh » 29 Sep 2009

Thanks Super, that should do the trick. Sometimes the easy solution is the last thing you consider :-)

Return to “MultiCharts”