question re time syntax
Forums › ProRealTime English forum › ProOrder support › question re time syntax
- This topic has 11 replies, 6 voices, and was last updated 5 years ago by
MAKSIDE.
-
-
04/13/2020 at 9:58 PM #125997
To specify an algo’s active time I have normally used
1time >= 080000 and time <210000Then I got it in my head that i could save a lot of zeros by using this instead:
1hour >= 8 and hour <21The two seemed to be interchangeable, until just now when I found an algo that returns completely different results for time as opposed to hour.
Do they mean different things then? Couldn’t find an answer in the manual.
04/13/2020 at 10:00 PM #126000000030 is greater than 21, but not than 210000!
1 user thanked author for this post.
04/13/2020 at 10:19 PM #126002As Roberto points out – it depends on the time frame that you run your strategy on. On a 1 hour based strategy there is only a candle every hour so TIME = 080000 is the same as HOUR = 8 but on a 1 minute time frame there are 59 candles in between where HOUR = 8 but TIME does not equal 080000.
1 user thanked author for this post.
04/13/2020 at 10:37 PM #126003OK, got it. Hour =8 includes everything in the 8th hour up to the last candle before 9.
Second question: the main reason I changed was not of course to save zeros, but because it made it easier to optimize on the half hour. How would I check a range of times eg 170000 to 230000 by half hour? Steps of 3000 won’t work.
04/13/2020 at 10:46 PM #126004What I had been doing is running it twice, first on the hour 170000 to 230000, then on the half hour 173000 to 233000 — both by steps of 10000.
Is there a better way?
04/13/2020 at 11:27 PM #126006I use 10000 steps (1 hour), so you can use 3000 (30 minutes), provided your TF ends on a 30-minute boundary, that is it must not have to be greater than 30 minutes.
1 user thanked author for this post.
04/14/2020 at 7:17 AM #126020I use 10000 steps (1 hour), so you can use 3000 (30 minutes)
But that would give you times such as:
170000
173000
176000 (not a valid time)
179000 (not a valid time)
182000
You will have an awful lot of tests with no results to run through.
Perhaps optimising with two variables would be better and more efficient. MyHour 0 to 23 in steps of 1 and MyMinute 0 to 1 step 1 and then add the following to the start of your strategy:
123456extra = 0if myminutes = 1 thenextra = 3000endifmytime = (myhour * 10000) + extra04/14/2020 at 8:21 AM #12602504/14/2020 at 9:07 AM #12603780000 is obviously not the same number as 8
Yes, my bank manager has been patiently trying to explain that to me.
1 user thanked author for this post.
04/14/2020 at 9:10 AM #126038Perhaps optimising with two variables would be better and more efficient. MyHour 0 to 23 in steps of 1 and MyMinute 0 to 1 step 1 and then add the following to the start of your strategy:
Very clever! I’ll try that, thanks.
04/14/2020 at 11:09 AM #126059Vonasi code above added as Log 205 here …
1 user thanked author for this post.
04/14/2020 at 4:46 PM #126129Vonasi code above added as Log 205 here …
It’s a treasure ! thx Grahal for the link
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on