Highest high and highest low of previous days and of specific schedules
Forums › ProRealTime English forum › ProOrder support › Highest high and highest low of previous days and of specific schedules
- This topic has 38 replies, 6 voices, and was last updated 5 years ago by robertogozzi.
Tagged: highest high, lowest low
-
-
11/24/2018 at 1:17 PM #85632
Flags and conditions do both may qualify either as true or false, thus easily tracked using GRAPH, the difference is that a condition is a test between two (sometimes even more) data, such as “close > close[1]” or “close CROSSES OVER Rsi[14]”, while a flag is a signal such as “flag” in this example or “daysforbidden” in some strategies when you do not want to trade or “TradeON” and so on….
In the code
1daysforbidden = OpenDayOfWeek < 1 OR OpenDayOfWeek > 5“OpenDayOfWeek < 1 OR OpenDayOfWeek > 5” is the condition to be checked and you can graph it with
1GRAPH OpenDayOfWeek < 1 OR OpenDayOfWeek > 5it will yieald a True/False logical value assigned to DAYSFORBIDDEN, which is a flag (and you can GRAPH it by itself, without having to write the longer line above), like a traffic lights, they are a flag to signal that some time has passed (the condition previously set) since it changed colour and needs to be changed again, you see the flag changing colour.
It is a common variable that may be either true or false, you can use any name, flag is just a nickname to make it easier to understand that it signals something.
“pi = 3.14” is not a flag, PI is just a common variable holding a numeric value, not a logical value.
The above code could have been written
1234567891011121314if time = 210000 thenTradeOrNot = 1endif.//IF NOT LongOnMarket AND TradeOrNot and time = 143000 THEN..ENDIF.//later:if time = 203000 thenTradeOrNot = 0endifI hope I understood what you meant.
11/24/2018 at 1:55 PM #85633I hope I understood what you meant.
Yes you did!
Thank you for the comprehensive explanation.
I’ve achieved same result in a long-winded way … but I’ll set a flag / signal next time in my coding.
Cheers
GraHal02/21/2019 at 4:42 PM #9194202/21/2019 at 4:53 PM #9194402/21/2019 at 5:05 PM #91946close * 1000 is just a way to assign variables all and ll a very high value the first time or whenever they needs to be reset, so that Min() can later assign them a correct value, I prefer writing ll=999999, but both achieve the same goal.
To be able to enter any trade you must launch it from a TF whose candles close on anyone of the times in the strategy. If you refer time 143000, then you can only use a TF <= 30 minutes, if you want to use the Daily TF… you need to change the code but you will probably write another strategy.
02/21/2019 at 5:37 PM #91952Hello,
Sure, for the min() function, I found it out a few minutes after ^^
I changed the hours to use it on DAX :
starthour = 013000
endhour = 220000But still, even on 30 15 5 min or 1h, notjing is displayed.
I just changed these hours.
Thank you,
02/21/2019 at 5:44 PM #91954You should post your code, so I can replicate it.
02/24/2019 at 10:47 AM #92178Hello,
Here is my code :
123456789101112131415161718192021starthour = 013000endhour = 220000count = today-datetcondition = time>=starthour and time<=endhourif count<=5 and count>0 thenif tcondition thenhh=max(hh,high)ll=min(ll,low)endifif tcondition[1] and not tcondition thendrawhline(hh) coloured(0,255,0)drawhline(ll) coloured(255,0,0)hh=0ll=close*1000endifendifreturnI think the starthour format is not working…
But I found this approach more satisfying :
https://www.prorealcode.com/topic/configuration-plus-haut-plus-bas-precedent/
02/25/2019 at 1:19 AM #92217It’s beacuse the condition COUNT in line 4 is always 0, since both TODAY and DATE return the same value.
Also, bear in mind that math applied to dates does not yield correct result (as in spreadsheets), TODAY – 30 will not return the date of 30 days ago, if today is 20190220, it will return 20190190.
-
AuthorPosts
Find exclusive trading pro-tools on