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:
Also, here is a screenshot of the session information for the symbol i am using:
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
Setexitonclose Inconsistent Behaviour
- master.aurora
- Posts: 33
- Joined: 21 Jan 2013
- Location: Islamabad
- Has thanked: 6 times
- Been thanked: 3 times
- Contact:
- TJ
- Posts: 7752
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1034 times
- Been thanked: 2228 times
- TJ
- Posts: 7752
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1034 times
- Been thanked: 2228 times
- master.aurora
- Posts: 33
- Joined: 21 Jan 2013
- Location: Islamabad
- Has thanked: 6 times
- Been thanked: 3 times
- Contact:
Re: Setexitonclose Inconsistent Behaviour
My system Timezone is set to EST.What is your time zone?
What is 1800 in your time?
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
- TJ
- Posts: 7752
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1034 times
- Been thanked: 2228 times
Re: Setexitonclose Inconsistent Behaviour
1800? how does that relate to the time on your log? What time is 2pm on your log?My system Timezone is set to EST.What is your time zone?
What is 1800 in your time?
You have to post your code for further analysis.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
- master.aurora
- Posts: 33
- Joined: 21 Jan 2013
- Location: Islamabad
- Has thanked: 6 times
- Been thanked: 3 times
- Contact:
Re: Setexitonclose Inconsistent Behaviour
From what i think, it is the GMT time of 1800.1800? how does that relate to the time on your log? What time is 2pm on your log?My system Timezone is set to EST.What is your time zone?
What is 1800 in your time?
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 functionYou have to post your code for further analysis.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
Regards
Umer
-
- Posts: 742
- Joined: 09 Apr 2010
- Location: Texas
- Has thanked: 483 times
- Been thanked: 274 times
- Contact:
Re: Setexitonclose Inconsistent Behaviour
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.
Re: Setexitonclose Inconsistent Behaviour
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
"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
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Setexitonclose Inconsistent Behaviour
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.
Please run your strategy with the Default session template, in Local Time Zone and attach a screenshot of its performance.