Exitonclose rejected

Questions about MultiCharts and user contributed studies.
NiC72
Posts: 92
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 34 times
Been thanked: 12 times

Exitonclose rejected

Postby NiC72 » 04 May 2010

Exitonclose dont work..
The logg writes:
2010-05-04 17:27:07 Order rejected - reason:Exchange is closed

Exchange is closing 17:27 and Session end time is 17:27.

NiC72
Posts: 92
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 34 times
Been thanked: 12 times

Postby NiC72 » 04 May 2010

The SetExitOnClose is working fine in historical simulations but its not ok if it close some times and some times not i real-world.

Is the solution to sell/buytocover, "next bar at market" at 17:26?

Or, to set Session end time to 17:26?
Even that Exchange is closing 17:27..

Or, have IB some funtion (that I havn't found) that end all active order when Exchange is closing?

To avoid gap/rate, there must be some feature that people often use when daytrade future.. Grateful for all suggestions.

User avatar
TJ
Posts: 6585
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1907 times

Postby TJ » 04 May 2010

what symbol are you trading?

does it have an after hour session?

what is your chart resolution? 5min?

User avatar
TJ
Posts: 6585
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 971 times
Been thanked: 1907 times

Postby TJ » 04 May 2010

I would take the manual's suggestion and not want to use SetExitOnClose in live trading.


most broker/exchanges recommend you enter your last order at least 3 minutes before closing.

you can try something like this:

Code: Select all

input:
last.order.time(1723);

if time > last.order.time then
begin
    sell...
    buy to cover...
end;



.

NiC72
Posts: 92
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 34 times
Been thanked: 12 times

Postby NiC72 » 04 May 2010

Uses OMXS30 (Swedish index futures). Resolution: 60 change. Use Custom Session (In Session Symbol = Symbol Root couldnt be found).

TJ, Thanks for your answers and experience. I will use it :)

SUPER
Posts: 624
Joined: 03 Mar 2007
Has thanked: 99 times
Been thanked: 80 times

Postby SUPER » 05 May 2010

NiC72,

Here's link to forum page where you can download code with works very well in realtime.

http://forum.tssupport.com/viewtopic.ph ... ght=#21297

regards
Super

NiC72
Posts: 92
Joined: 02 Nov 2009
Location: Sweden
Has thanked: 34 times
Been thanked: 12 times

Postby NiC72 » 05 May 2010

Thanks Super, it was excellent .. I've tried it now and was really pleased :-)


Return to “MultiCharts”