Support and resistance zones with variables arrays

Forums ProRealTime English forum ProBuilder support Support and resistance zones with variables arrays

Viewing 9 posts - 16 through 24 (of 24 total)
  • #126151

    I don’t really get your point 1. My array is not sorted, so if I want to compare one item with all items, I can’t do z=x, otherwise you compare only with smaller and smaller items.

    On the other hand, your second point seems indeed to solve the issue, thx I wouldn’t have found it!!!

    Now the point I would like to improve is around the fractal, to filter the reversal points and retain only the most relevant one… Would need your help on that too;)

    I’m noticing also that the most recent overlap is sometimes blinking with each new change of price, weird…

     

    1 user thanked author for this post.
    #126168
    lines 50

     

    instead of

     

    #126180

    To put things into perspective for those who not benefit yet from the V11, please find in attachment what the indicator is drawing automatically on the Dow Future 15min.

    Awesome! Still needs further work in my view however.

    Nicolas, I hope arrays are available for probacktest?

    2 users thanked author for this post.
    #126210

    Very very nice stefou! Well done. This proves the efficiency and the necessity of data arrays to build stunning indicator!

    to filter the reversal points and retain only the most relevant one…

    Ok, but how do you consider a ‘relevant one’?

    You can use arrays in ProBacktest, but you’ll have to put your whole code into the strategy!

    #126324

    The relevant one =

    1. min distance between a high and low fractal to avoid extreme created during low volatility period
    2. if there are two consecutive lows without a high in between, only takes into account the lowest one, and disregard the other. Same for top

    I have tried somethings for point 2 but this isn’t working, code is very slow and doesn’t do what I want.

     

     

    1 user thanked author for this post.
    #167269

    Hi @stefou102, congrats for your work. Any updates on this interesting indicator?

    #196457

    Hi Stef, just tried this last version of the code on v11 (SP500) and it doesn’t show anything on the graph (price). Any clue how to make it work?

    Thanks

    #203403

    Any News here to get it work for V11?

    #213801

    Hi Stefou, I was thinking about the possibility to compare tops and bottoms and the only idea I had was to put both Tops and bottoms in the same array. The problem of not having overlapping of too many lows and highs remain. I tried to reset the array with a counter, in order to keep the highs and lows only after a specific bars but for some reason it does not work. the variable Barlimit is useless. I put what I did here as it follows.

    // https://www.prorealcode.com/topic/array-variables-availability-in-prorealtime/
    // (please do not remove the link above for future reference)
    // Example #1: support and resistance example, based on fractals points

    // — settings
    fractalP = 10
    percent = 0.5
    barlimit = 500
    // — end of settings
    DLS =(Date >= 20220101)
    //fractals
    cp=fractalP
    if high[cp] >= highest[(cp)*2+1](high) then //new fractal high found
    $FRACTy[lastset($FRACTy)+1] = high[cp] //store fractal value
    $FRACTx[lastset($FRACTx)+1] = barindex[cp] //store fractal barindex
    ELSE
    if low[cp] <= lowest[(cp)*2+1](low) then //new fractal low found
    $FRACTy[lastset($FRACTy)+1] = low[cp] //store fractal value
    $FRACTx[lastset($FRACTx)+1] = barindex[cp] //stire fractal barindex
    endif

    if(islastbarupdate and isset($FRACTy[0])) then
    //check points in a range of X percent
    for i = 0 to lastset($FRACTy) do //loop through the tops
    for y = 0 to lastset($FRACTy) do //check first top with other tops
    change=abs(($FRACTy[y]-$FRACTy[i])/$FRACTy[i]) //percent range between the 2 tops
    if change<=percent/100 and barindex-$FRACTx[y]<barlimit and DLS and $FRACTx[i]<>$FRACTx[y] then
    if close>min($FRACTy[y],$FRACTy[i]) then //define the color
    r=0
    g=255
    else
    r=255
    g=0
    //if $FRACTx[y]>barlimit and $FRACTx[i]>barlimit then
    //$FRACTY[y]=0 and $FRACTY[i]=0
    //endif
    endif
    //plot points at each tops
    DRAWPOINT($FRACTx[i],$FRACTy[i],2) COLOURED (r,g,0) BORDERCOLOR (r,g,0)
    DRAWPOINT($FRACTx[y],$FRACTy[y],2) COLOURED (r,g,0) BORDERCOLOR (r,g,0)
    midlevel=($FRACTy[i]+$FRACTy[y])/2
    //display the mid level price
    DRAWTEXT(“#midlevel#”, barindex+8, midlevel, monospaced, standard, 14)
    //plot the zone
    drawrectangle(min($FRACTx[y],$FRACTx[i]),$FRACTy[y],barindex,$FRACTy[i]) coloured(r,g,50,50) bordercolor(r,g,0)
    endif
    next
    next
    endif
    endif
    return

Viewing 9 posts - 16 through 24 (of 24 total)

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