Help to find maximum between 2 periods
Forums › ProRealTime English forum › ProOrder support › Help to find maximum between 2 periods
- This topic has 5 replies, 4 voices, and was last updated 7 years ago by JC_Bywan.
-
-
04/01/2017 at 4:58 PM #3062404/02/2017 at 8:42 AM #30647
Its something I often need to do, I do it like this as it appears that Highest only takes a single parameter.
Be interested to find out from someone if there is a more elegant way to do this.1234567StartBar = 'YourStartValue'EndBar = 'YourEndValue'HighValue = 0for Counter = StartBar to EndBarHighValue = max(HighValue,close[Counter])next04/02/2017 at 4:36 PM #30728Hi Raffaele and Autostrategist,
@Autostrategist, you’re right in saying highest only takes one parameter, but it also accepts to look at previous values of itself, which, even if it’s not a “pure” second parameter like “start, finish”, allows for the kind of solution I think you’re asking for without a for to/next loop: assuming lead post of the topic was counting from current bar towards the left until bars 45 and 126, we can look at what was the value at 45th past candle of highest during an interval of (126-45+1)=82 candles with the following syntax:1Highvalue=highest[82](close)[45](edit: example here done with “close”, but also works with “high” instead of “close” when purpose is to find highest high of interval rather than highest close)
3 users thanked author for this post.
04/02/2017 at 6:13 PM #30742Thanks Noobywan I was hoping when I responded that there was a better way than mine.
My question though is how a user finds this information, I may have overlooked it but I don’t see this in the documentation or am I just looking in the wrong place? Here is another example that Nicholas wrote, where can I find the list of all the parameters that summation or any other function accepts?
bearpattern = summation[Xcandlesticks](close<open)=Xcandlesticks
04/03/2017 at 2:06 AM #30769This forum may help a lot, but I urge PRT to improve documentation, since it’s poorly made, with few examples.
04/03/2017 at 10:57 AM #30798Well I wish I could help more with finding this in the doc, but it’s not something I found there, it’s just a syntax usage I explored by “trial and error”, when I first wondered a while ago if adding [n] to call value of n’th previous candle could work when added to, not just easy terms (like close[n] as they show bottom of page 7 of pro-builder manual), but also to already complex terms like highest[a](variable) or exponentialaverage[b](blabla) or basically anything having already other stuff in various brackets… turns out it does, but I can’t say I saw it somewhere in the doc, can’t even say if it works only for some and not for others, I haven’t tried all existing combinations.
So I can only share my own findings, but I can’t point to a specific part of the manual for this, other than page 7 and its (too) basic examples… and I’m not saying it’ not in there somewhere either, maybe it is and I missed it…
For all of us wanting doc improvements, best way is to express this wish in Nicolas’ existing wish list: https://www.prorealcode.com/topic/centralization-of-queries-and-suggestions-on-prorealtime/
and/or perhaps the PRT suggestions contact form for next version 10.4 too: https://www.prorealtime.com/en/contact?suggestion=1
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on