Help to find maximum between 2 periods

Forums ProRealTime English forum ProOrder support Help to find maximum between 2 periods

Viewing 6 posts - 1 through 6 (of 6 total)
  • #30624

    Good afternoon everybody .
    I’m looking for a code to calculate a maximum or a minimum in a particular period.
    For example, the maximum from 45 bar to 126 ….etc
    Can someone help me….?

    #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.

    #30728

    Hi 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:

    (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.
    #30742

    Thanks 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

    #30769

    This forum may help a lot, but I urge PRT to improve documentation, since it’s poorly made, with few examples.

     

    #30798

    Well 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.
Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login