Compare highest high between two points

Forums ProRealTime English forum ProBuilder support Compare highest high between two points

Viewing 8 posts - 16 through 23 (of 23 total)
  • #9788

    Yes, that’s why I point you to this problem already :

    http://www.prorealcode.com/topic/compare-highest-high-between-two-points/#post-9711

     

    #9802

    I appreciate your assistance however; I don’t understand the quote “you should test if the 6 periods one is inferior or superior with a candlestick offset more longer:” How do I do this?

    I’m a relative newbie and wouldn’t know how to code this. All I need is to find a way of coding highest[7 to 40](high) and lowest[7 to 40](low)

    #9810

    Look at the c3 condition code of the previous reply I pointed you on. I’m using an offset between brackets more longer than 1 period (10 in my example). That’s how you can refer to a more far in the past of an indicator value.

    #10994

    Hi ck1066,

    have you solved this problem (to exclude the first 6 bars)??

    THANK YOU

    #10997

    Not yet. I’ve ran out of ideas how to do this. I suspect its more difficult than it sounds

    #10999

    Hello,

    I am new to this part of the forum in English as I must confess I didn’t read beyond the French part until now that I discover Nicolas is helping us all in no less than 5 different languages (tha’s impressive Nicolas!). I will pay more attention to the English forum too from now on.

    If I understand correctly your problem, I am guessing the part you might not know yet about PRT language is the meaning of the [n] syntax might change depending on which word it is used with. So first a bit more about this. Apologies if I’m wrong and you already knew all of this:

    Example 1: when you use a PRT specific term refering to several bars at the same time, like “lowest” + a number in bracket (say, lowest[6]) then yes you are refering to all the latest 6 bars to find the lowest among those.

    Example 2: if you use a PRT specific term refering to only one bar, like “low”, then the number in brackets is not a total number of recent bars here, but it is the rank of the previous single bar you are looking at, for example low[1] or high [1] (which you used in your code) are refering to the previous bar, but low[4] or high[4] would have refered to bar number 4 in the past with previous one being 1, etc…

    Now, when you use the [n] syntax for a variable defined by yourself, such as hh1[n], then you are not looking at what happens for all the latest n bars like in example 1, you are looking at the value of your hh1 variable for the bar numbered “n” in the past like in example 2 (starting from current bar being number zero).

    From there, you should see that Nicolas did indeed answer in principle when he suggested for example to look at lh1 [1] (value of lh1 for previous bar) and lh2[10] (value of lh2 for 10th bar in the past starting from current bar being number zero)

    Consequently, if you want to to find a way of coding highest[7 to 40](high), I would look at values between 7 and 40 in the past by using Nicolas’ suggestion as follows: pick hh2[6] so that you succesfully exclude the latest 6 bars number zero, 1,2,3,4,5 and also define hh2 as highest[34](high) so that from 7th bar (number 6) you don’t go further than 40th bar (number 39). If you kept highest[40](high) then hh2[6] would reach as far as 46th bar, and from what I understand, you don’t want that, you want no more than 40 in the past (from zero to 39). So I would try with:

    That’s how I’d do it, and same thing for ll, hl, lh…

    But considering you seem to want to look at a start from previous bar rather than from current bar, one last point I’d make if that’s important to you (meaning you want in fact to exclude 7 bars and not 6, or exclude current bar + 6 past ones if you will) : you could use c5=(hh1[1]>=hh1[7]) instead of my c5=(hh1>=hh1[6]) above. That choice of course is up to you and what you want to achieve with your code. Personnally, I like to see “live” result in current bar in my codes, and choosing to wait for current bar to close to see its frozen result, that’s why I went with c5=(hh1>=hh1[6]) first.

    3 users thanked author for this post.
    #11001

    Sorry, I should have read my message again more carefully before pushing the “submit” button. Can’t find any “edit” button, so allow me to correct my last paragraph with all the appropriate “hh2” instead of “hh1”. It should read:

    But considering you seem to want to look at a start from previous bar rather than from current bar, one last point I’d make if that’s important to you (meaning you want in fact to exclude 7 bars and not 6, or exclude current bar + 6 past ones if you will) : you could use c5=(hh1[1]>=hh2[7]) instead of my c5=(hh1>=hh2[6]) above. That choice of course is up to you and what you want to achieve with your code. Personnally, I like to see “live” result in current bar in my codes, and choosing to wait for current bar to close to see its frozen result, that’s why I went with c5=(hh1>=hh2[6]) first.

    #26930

    Hi Nicolas,

    I have another question regarding your initial reply (06/21/2016 at 11:42 AM) to this ticket you will no doubt be able to clear up for me.

    I have noticed that the above test is only valid if hh2  is within x bars, in this case 20. If hh2 is beyond 20 bars the test fails. It appears to treat hh2 value as 0 during comparison of the two points when hh2 is greater than x bars stated in the variable

    I’m basically trying to scan for bearish, or bullish, engulfing candles where the high, or low, of the last two candles is higher, or lower, than the last 20, 100 or even 200 bars, for reversal. I’m trying to test there’s sufficient space to the left of the engulfing candle.

Viewing 8 posts - 16 through 23 (of 23 total)

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