Close at specific times
8 replies
chengsmine
12 years ago #111670
Enclosed is my strategy. The strange thing is:
When I deleted all the rules after 8(3) and 8(4), I was able to close the trades at the specific times in 8(3) and 8(4) when the required condition, i.e. Open (P/L) > 0 is satisfied. Once I added all the rules after 8)3) and 8(4), no trades were closed at those specific times. Actually, all the rules after 8(3) and 8(4) could not be executed either. Why?
0
chengsmine
12 years ago #122868
Please see my greatly shortened strategy. There is only 1 rule. It appears that the Time and Hour values do not work, since I was never able to close any existing trades if these values are GMT.
0
chengsmine
12 years ago #122869
Sorry. My shortened strategy is as follows.
I AM UNABLE TO ATTACH THE STRATEGY. Please see my email.
0
chengsmine
12 years ago #122872
I am able to upload my sqw file now. Please note that thte Hour and Minute values are clearly not GMT values, since when I tested them, my pending orders (created previously) were not closed at GMT values after checking with my clock. Even after I changed the rule to TimeCurrent (I assume it to be GMT value also), in the format X(hour)Y(min)Z(second), I still was not able to close the orders. I used to be able to close the orders using the 2.0 version.
0
chengsmine
12 years ago #122876
I have found that the condition
Time (0) = GetTime(Hour.Minute.Second) works. But not Hour (0), Minute (0).
0
chengsmine
12 years ago #122879
The GetTime function seems to work only a few times. Now it is not working.
0
chengsmine
12 years ago #122884
After the market opened today, GetTime Function worked. But after I changed the time a couple of times, it failed to work again.
0
chengsmine
12 years ago #122887
I have discovered that if I change the time frequently, like every 3-4 minutes, GetTime will NOT work. If I wait for 10-12 hours before changing the time, GetTime would work.
0
Mark Fric
12 years ago #122914
the problem could be in your comparison. Time returns opening time of current bar, so it changes only once per hour if you trade on 1 hour bars.
You can use TimeCurrent if you want to see actual time value of every tick.
Mark
StrategyQuant architect
0
Viewing 8 replies - 1 through 8 (of 8 total)