Setexitonclose Inconsistent Behaviour

Questions about MultiCharts and user contributed studies.
User avatar
master.aurora
Posts: 33
Joined: 21 Jan 2013
Location: Islamabad
Has thanked: 6 times
Been thanked: 3 times
Contact:

Setexitonclose Inconsistent Behaviour

Postby master.aurora » 23 Sep 2013

Hello Support,

I have a strategy that i am trying to backtest. It used the Setexitonclose keyword. I am getting inconsistent behaviour with it while backtesting. Following is a screenshot from one of my backtest runs:

Image

Also, here is a screenshot of the session information for the symbol i am using:

Image

Now, the trade boxed in red opened at 9:00 PM on the 28th. And was closed 5:00 PM on the 29th. While the example boxed in blue shows a trade opened on the 9th at 7:00 AM and closed; from what i think using the setexitonclose feature at 2:00 PM.

If my above assumption is correct and the trade boxed in blue did exit using the setexitonclose feature, then why dont the first trade in the example close at 2:00 PM as well?

Please advise.

Regards
Umer

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Setexitonclose Inconsistent Behaviour

Postby TJ » 23 Sep 2013

What is your time zone?
What is 1800 in your time?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Setexitonclose Inconsistent Behaviour

Postby TJ » 23 Sep 2013

see post #6
Setexitonclose
viewtopic.php?f=16&t=10811

User avatar
master.aurora
Posts: 33
Joined: 21 Jan 2013
Location: Islamabad
Has thanked: 6 times
Been thanked: 3 times
Contact:

Re: Setexitonclose Inconsistent Behaviour

Postby master.aurora » 23 Sep 2013

What is your time zone?
What is 1800 in your time?
My system Timezone is set to EST.

Also, i am not really looking for a workaround here, but trying to find out the cause of this inconsistency as i have to convert this strategy for another trading tool.

Thanks
Umer

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Setexitonclose Inconsistent Behaviour

Postby TJ » 23 Sep 2013

What is your time zone?
What is 1800 in your time?
My system Timezone is set to EST.
1800? how does that relate to the time on your log? What time is 2pm on your log?
Also, i am not really looking for a workaround here, but trying to find out the cause of this inconsistency as i have to convert this strategy for another trading tool.
Thanks
Umer
You have to post your code for further analysis.

User avatar
master.aurora
Posts: 33
Joined: 21 Jan 2013
Location: Islamabad
Has thanked: 6 times
Been thanked: 3 times
Contact:

Re: Setexitonclose Inconsistent Behaviour

Postby master.aurora » 23 Sep 2013

What is your time zone?
What is 1800 in your time?
My system Timezone is set to EST.
1800? how does that relate to the time on your log? What time is 2pm on your log?
From what i think, it is the GMT time of 1800.
Also, i am not really looking for a workaround here, but trying to find out the cause of this inconsistency as i have to convert this strategy for another trading tool.
Thanks
Umer
You have to post your code for further analysis.
I am afraid i cant really post my code here and also i do not think there is a need for the code here. The issue is with the understanding of this function

Regards
Umer

sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: Setexitonclose Inconsistent Behaviour

Postby sptrader » 23 Sep 2013

Maybe you could post an example of code, that behaves in a similar incorrect way..instead of your proprietary code...
Last edited by sptrader on 27 Sep 2013, edited 2 times in total.

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

Re: Setexitonclose Inconsistent Behaviour

Postby SUPER » 23 Sep 2013

master.aurora,

"SexExitOnClose" does not work at times on back testing and more so under live trading, try using code posted sometime back here-which always works: viewtopic.php?f=5&t=7834

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Setexitonclose Inconsistent Behaviour

Postby Henry MultiСharts » 30 Sep 2013

Umer, what is the chart time zone (Format->Instrument->Settings->Time Zone)?
Please run your strategy with the Default session template, in Local Time Zone and attach a screenshot of its performance.


Return to “MultiCharts”