Order Activation

Questions about MultiCharts and user contributed studies.
fernando43611
Posts: 30
Joined: 12 Mar 2015
Has thanked: 4 times

Order Activation

Postby fernando43611 » 17 Jan 2018

Hi, I was wondering if theres a way to set orders to execute only when the market is open (regular trading hours). Thanks!

User avatar
TJ
Posts: 6667
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 973 times
Been thanked: 1925 times

Re: Order Activation

Postby TJ » 17 Jan 2018

fernando43611 wrote:Hi, I was wondering if theres a way to set orders to execute only when the market is open (regular trading hours). Thanks!



Auto trade FAQ
viewtopic.php?t=10811#p57739

Gaempi
Posts: 41
Joined: 27 Jul 2010
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Re: Order Activation

Postby Gaempi » 19 Jan 2018

Yes, to activate orders by a timelimit is a way to go. Sure!

BUT: There should be a command (keyword) to deactivate all open orders at broker.

User avatar
TJ
Posts: 6667
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 973 times
Been thanked: 1925 times

Re: Order Activation

Postby TJ » 19 Jan 2018

Gaempi wrote:Yes, to activate orders by a timelimit is a way to go. Sure!

BUT: There should be a command (keyword) to deactivate all open orders at broker.



You can make a feature request:

https://www.multicharts.com/pm/public/m ... 9/search/1

Gaempi
Posts: 41
Joined: 27 Jul 2010
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Re: Order Activation

Postby Gaempi » 01 Feb 2018

Tell me, what's wrong here?

I'm trading with a normal 10 min bar chart and the market is closing officially at 6:00 pm. After 6:00 we have after market trading with low volum. So all open orders should be closed at the time. The last bar on chart ends at 6:00 pm.

My strategy has a timelimit to trade till 5:59. The stop loss limits and the profit target limits are timed till 5:59 and are sent to the broker.

Why? i want to limit the orders by time (5:59) because the orders should stop after 5:59.

What do i expect? I would expect that all open orders at the broker are closed after 5:59. Between 5:59 and 6:00 is enough time to close the open orders at the broker.

The result: The charts ends the day with the last tick at 6:00 ... AND ALL OPEN ORDERS STAY OPEN AT THE BROKER !!

I want have closed all open orders at broker after 5:59. Please, MC, give us a command (keyword) to close all (or specific) orders at the broker !!!

Thanks!

Gaempi
Posts: 41
Joined: 27 Jul 2010
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Re: Order Activation

Postby Gaempi » 01 Feb 2018

By the way: If i time all orders till 5:58, all orders stay open at broker at 5:59, 6:00, 6:01, ...

User avatar
TJ
Posts: 6667
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 973 times
Been thanked: 1925 times

Re: Order Activation

Postby TJ » 01 Feb 2018

Who is your broker?
What instrument are you trading?

Gaempi
Posts: 41
Joined: 27 Jul 2010
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Re: Order Activation

Postby Gaempi » 01 Feb 2018

My broker is Interactive Brokers (IB). I'm trading on the EUREX different futures.

User avatar
TJ
Posts: 6667
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 973 times
Been thanked: 1925 times

Re: Order Activation

Postby TJ » 01 Feb 2018

Can you set the orders at the broker to "Day" order only?

Gaempi
Posts: 41
Joined: 27 Jul 2010
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Re: Order Activation

Postby Gaempi » 02 Feb 2018

Yes, they are day orders! But after the official trading time till 06:00 pm the trading goes on 2 houres more. So the orders are open at IB till 8:00 (end of after trading session) and were closed by IB at that time.

I want to close the open oders 1 minute before 6:00 pm because after this time the trading volume is to low to get good signals and good prices. So there should be a way to stop (cancel) all open orders at IB at e specific time.

Multicharts, show us a way to cancel automatically open orders at the broker if we want to do this. THANKS!

Zheka
Posts: 111
Joined: 13 Jan 2016
Has thanked: 5 times
Been thanked: 17 times

Re: Order Activation

Postby Zheka » 02 Feb 2018

Is your IOG setting ON? If not, then it is no wonder that everything gets evaluated only at each 10-min bar close..

Search the forum - this has been discussed with regards to SetExitOnClose.

You can also set your Data1 as 1min, and Data2 as 10min, and this will allow conditions to be evaluated with 1-min granularity.

User avatar
TJ
Posts: 6667
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 973 times
Been thanked: 1925 times

Re: Order Activation

Postby TJ » 02 Feb 2018

Gaempi wrote:Tell me, what's wrong here?

I'm trading with a normal 10 min bar chart and the market is closing officially at 6:00 pm. After 6:00 we have after market trading with low volum. So all open orders should be closed at the time. The last bar on chart ends at 6:00 pm.

My strategy has a timelimit to trade till 5:59. The stop loss limits and the profit target limits are timed till 5:59 and are sent to the broker.

Why? i want to limit the orders by time (5:59) because the orders should stop after 5:59.

What do i expect? I would expect that all open orders at the broker are closed after 5:59. Between 5:59 and 6:00 is enough time to close the open orders at the broker.

The result: The charts ends the day with the last tick at 6:00 ... AND ALL OPEN ORDERS STAY OPEN AT THE BROKER !!

I want have closed all open orders at broker after 5:59. Please, MC, give us a command (keyword) to close all (or specific) orders at the broker !!!

Thanks!



This is a coding question.

Please post your codes.

Gaempi
Posts: 41
Joined: 27 Jul 2010
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Re: Order Activation

Postby Gaempi » 09 Feb 2018

Yes, that is the important point: IOG setting should be in the strategy ON. So the orders can be closed at the broker before the end of the bar closing and before the end of the market session.

BUT this not the solution of the problem: My strategies work much better with the IOG is OFF.

So we trader need another solution: We need a program code to cancel (all or specific) open orders at the broker. TJ says it is a coding question.

MultiCharts: Please, give us this code and the possibility to close open orders at a specific time.

Zheka
Posts: 111
Joined: 13 Jan 2016
Has thanked: 5 times
Been thanked: 17 times

Re: Order Activation

Postby Zheka » 09 Feb 2018

In MC, for orders to stay open an entry condition needs to be satisfied at each bar.

Set each day's session end time at 5:59 p.m. ( or even 6:00pm). In theory, as the bar closes (I guess you are using Daily bars, right?), entry condition will get re-evaluated, current orders - cancelled, new orders - if any - get placed.

This is assuming you do not need/want to use prices from 6 to 8 p.m. as part of your bars and can cut a session at 6p.m. and start in the morning.

Gaempi
Posts: 41
Joined: 27 Jul 2010
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Re: Order Activation

Postby Gaempi » 09 Feb 2018

As i have said i use 10 min bar chart. If the 10 min bar closes at 6:00 pm the chart marks the end of the official session (no new bars after this time). At that point the open orders at broker are not new evaluated because MultiCharts don't do this (IOG = Off) and the session is over.

I think it is time to hear something from MultiCharts.

Thanks!

User avatar
TJ
Posts: 6667
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 973 times
Been thanked: 1925 times

Re: Order Activation

Postby TJ » 09 Feb 2018

Gaempi wrote:As i have said i use 10 min bar chart. If the 10 min bar closes at 6:00 pm the chart marks the end of the official session (no new bars after this time). At that point the open orders at broker are not new evaluated because MultiCharts don't do this (IOG = Off) and the session is over.

I think it is time to hear something from MultiCharts.

Thanks!



You need to learn how to code.

People have been using EasyLanguage for 30 years; you are not the first to have this trading logic.



ps. I am not saying EasyLanguage cannot be improved. If you have a feature request, please open a case in ProJectManagement.
https://www.multicharts.com/pm/public/multicharts

Gaempi
Posts: 41
Joined: 27 Jul 2010
Location: Switzerland
Has thanked: 1 time
Been thanked: 2 times

Re: Order Activation

Postby Gaempi » 09 Feb 2018

I'm coding EasyLanguage and profitable systems more than 16 years. And i have not found a solution for this problem. If you (TJ) mean and advice us to learn how to code then you (or MultiCharts or other) traders can show us the way or show the code.

There is till now no code to solve this problem because MC has no commands in EasyLanguage to tell the broker to cancel open orders after a specific time.

Zheka
Posts: 111
Joined: 13 Jan 2016
Has thanked: 5 times
Been thanked: 17 times

Re: Order Activation

Postby Zheka » 09 Feb 2018

Code: Select all

Input: stime(1220);

Var: ii(0),jj(0),ec(0);

if average(close,5) > average(close,10) and time<stime
 then
begin
 if ii=0 then ec=close;
 ii+=1;  jj=0;
 
 buy next bar at ec+5*averagetruerange(10) stop;
end;

if average(close,5) < average(close,10) and time<stime
 then
begin
 if jj=0 then ec=close;
 jj+=1;  ii=0;
 
 sell short next bar at ec-5*averagetruerange(10) stop;
end;

Order will get cancelled after time>=stime.
Just confirmed trading IB demo account.


Return to “MultiCharts”