Strange Realtime Behaviour

Questions about MultiCharts and user contributed studies.
User avatar
LRP
Posts: 153
Joined: 07 Apr 2008
Location: Switzerland
Has thanked: 96 times
Been thanked: 15 times

Strange Realtime Behaviour

Postby LRP » 06 May 2008

Dear TS Support

In Realtimode the MC-Build-In-Strategy "Close at the End of Day" do not execute to close the open position. After "Reload" the Chart I get an execution to close the Position.
With Backtests it works fine, but not so with streaming "Realtime Datas"
What is going wrong?
Thank you very much for your help
Cordially
LRP
Attachments
EndOfDayExit.png
(50.64 KiB) Downloaded 388 times

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Postby ABC » 06 May 2008

LPR,

I'd recommend "Close at End of Day" only for historical simulations. The reason for this, it generates the order on the last tick of the session, which gives you no chance to get filled in realtime (the market is just closed with your trigger). That's probably the reason why you see the trades in history, but not in realtime.
Quote from TS help:
For historical simulations, SetExitOnClose generates a market order on the bar close event of the last intra-day bar for each day in the chart. When used in an automated strategy placing real-world orders, SetExitOnClose generates a limit order into the post market trading session, (if one exists), otherwise a market order is generated for the open of the next regular session day.
So for realtime trading you should ensure that your orders are closed prior to market close.

Best regards,
ABC

SUPER
Posts: 646
Joined: 03 Mar 2007
Has thanked: 106 times
Been thanked: 84 times

Postby SUPER » 06 May 2008

That is how it is supposed to work and it is only useful for backtesting, SetExitOnClose function used in MC example does not keep track of Session start or end time.

Real-time you will have to code exit based on computer clock or time.

i.e if time > ..... then sell or buy etc.

User avatar
LRP
Posts: 153
Joined: 07 Apr 2008
Location: Switzerland
Has thanked: 96 times
Been thanked: 15 times

Postby LRP » 06 May 2008

Thank you very much ABC and SUPER.
Ok, i understand what you mentioned. That seems to be clear so far.
But what i do not understand, when I set in QM the closing time (-1min) e.g. FDAX 21:59 (effective close at 22:00) => No Closing execution until hit "Reload"

PE-Manual:
SetExitOnClose
Closes out the current position at the Close tick of the last bar of the trading session on an intra-day chart; generates the appropriate Market exit order depending on whether the position is long or short.
SetExitOnClose function uses the session closing time specified in the session settings for the symbol in the QuoteManager.

THX again and best regards
LRP

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Postby ABC » 06 May 2008

LRP,

I am not sure, but I guess if you set the closing time to 21:59, then your chart will end at that time, too. So SetExitOnClose will behave the same like before.

Best regards,

ABC


Return to “MultiCharts”