Conversión Pivot Points

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #238760 quote
    Maricarmen
    Participant
    New

    Buenas:

    Se podría hacer la conversión de este indicador:

    https://es.tradingview.com/script/OxJJqZiN-Pivot-Points-High-Low-Missed-Reversal-Levels-LuxAlgo

    Gracias

    #238787 quote
    Iván González
    Moderator
    Master

    Buenas!
    Aquí tienes el código traducido:

    //---------------------------------------------------//
    //Pivot Points High Low and Missed Reversal Levels
    //version = 0
    //09.10.2024
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //---------------------------------------------------//
    //                   INPUTS                          //
    //---------------------------------------------------//
    prd = 50
    showMiss=1
    showReg=1
    //---------------------------------------------------//
    //                   PIVOTS LOW                      //
    //---------------------------------------------------//
    src1 = low
    if src1 > src1[prd] and lowest[prd](src1) > src1[prd] and src1[prd] < lowest[prd](src1)[prd+1] then
    $ply[z+1] = src1[prd]
    $plx[z+1] = barindex[prd]
    z = z + 1
    endif
    //---------------------------------------------------//
    //                   PIVOTS HIGH                     //
    //---------------------------------------------------//
    src2 = high
    if src2 < src2[prd] and highest[prd](src2)<src2[prd] and src2[prd]>highest[prd](src2)[prd+1] then
    $phy[t+1]=src2[prd]
    $phx[t+1]=barindex[prd]
    t=t+1
    endif
    //---------------------------------------------------//
    //---------------------------------------------------//
    once ghostlevel=undefined
    once os=0
    once px1=0
    once py1=0
    once maxX1=0
    once minX1=0
    
    n=barindex
    mimax=max(high[prd],mimax)
    mimin=min(low[prd],mimin)
    followmax=max(high[prd],followmax)
    followmin=min(low[prd],followmin)
    
    if mimax > mimax[1] then
    maxX1=n-prd
    followmin=low[prd]
    endif
    if mimin < mimin[1] then
    minX1=n-prd
    followmax=high[prd]
    endif
    
    if followmin<followmin[1] then
    followminX1=n-prd
    endif
    if followmax>followmax[1] then
    followmaxX1=n-prd
    endif
    //---------------------------------------------------//
    //---------------------------------------------------//
    if t<>t[1] then
    if showMiss then
    if os[1]=1 then
    drawtext("✖",minX1,mimin)coloured("green")
    drawsegment(px1,py1,minX1,mimin)style(dottedline)coloured("red")
    px1=minX1
    py1=mimin
    //GhostLevel
    drawsegment(px1,py1,n-prd,py1)style(line,2)coloured("green")
    elsif $phy[t]<mimax then
    drawtext("✖",maxX1,mimax)coloured("red")
    drawtext("✖",followminX1,followmin)coloured("green")
    drawsegment(px1,py1,maxX1,mimax)style(dottedline)coloured("green")
    px1=maxX1
    py1=mimax
    //GhostLevel
    drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("red")
    drawsegment(px1,py1,followminX1,followmin)style(dottedline)coloured("red")
    px1=followminX1
    py1=followmin
    //GhostLevel
    drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("green")
    endif
    endif
    if showReg then
    drawtext("▼",$phx[t],$phy[t])coloured("red")
    if $phy[t]<mimax or os[1]=1 then
    drawsegment(px1,py1,n-prd,$phy[t])style(dottedline)coloured("green")
    else
    drawsegment(px1,py1,n-prd,$phy[t])style(line)coloured("green")
    endif
    endif
    py1=$phy[t]
    px1=n-prd
    os=1
    mimax=$phy[t]
    mimin=$phy[t]
    endif
    //---------------------------------------------------//
    //---------------------------------------------------//
    if z<>z[1] then
    if showMiss then
    if os[1]=0 then
    drawtext("✖",maxX1,mimax)coloured("red")
    drawsegment(px1,py1,maxX1,mimax)style(dottedline)coloured("green")
    px1=maxX1
    py1=mimax
    //GhostLevel
    drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("red")
    elsif $ply[z]>mimin then
    
    drawtext("✖",followmaxX1,followmax)coloured("red")
    drawtext("✖",minX1,mimin)coloured("green")
    drawsegment(px1,py1,minX1,mimin)style(dottedline)coloured("red")
    px1=minX1
    py1=mimin
    //GhostLevel
    drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("green")
    
    drawsegment(px1,py1,followmaxX1,followmax)style(dottedline)coloured("green")
    px1=followmaxX1
    py1=followmax
    //GhostLevel
    drawsegment(px1,py1,max(n-prd,px1+prd),py1)style(line,2)coloured("red")
    endif
    endif
    if showReg then
    drawtext("▲",$plx[z],$ply[z])coloured("green")
    if $ply[z]>mimin or os[1]=0 then
    drawsegment(px1,py1,n-prd,$ply[z])style(dottedline)coloured("red")
    else
    drawsegment(px1,py1,n-prd,$ply[z])style(line)coloured("red")
    endif
    endif
    py1=$ply[z]
    px1=n-prd
    os=0
    mimax=$ply[z]
    mimin=$ply[z]
    endif
    //---------------------------------------------------//
    //---------------------------------------------------//
    if islastbarupdate then
    x=0
    y=0
    $prices[0]=0
    $pricesx[0]=0
    
    for i=0 to n-px1-1 do
    if os=1 then
    $prices[i]=low[i]
    $pricesx[i]=n-i
    else
    $prices[i]=high[i]
    $pricesx[i]=n-i
    endif
    next
    
    if os=1 then
    y=ArrayMin($prices)
    for j=0 to n-px1-1 do
    if low[j]=y then
    x=n[j]
    break
    endif
    next
    if showmiss then
    drawtext("✖",x,y)coloured("green")
    drawsegment(px1,py1,x,y)style(dottedline)coloured("red")
    endif
    drawsegment(x,y,n,y)style(line,2)coloured("red")
    else
    y=arraymax($prices)
    for j=0 to n-px1-1 do
    if high[j]=y then
    x=n[j]
    break
    endif
    next
    if showmiss then
    drawtext("✖",x,y)coloured("red")
    drawsegment(px1,py1,x,y)style(dottedline)coloured("green")
    endif
    drawsegment(x,y,n,y)style(line,2)coloured("green")
    endif
    endif
    //---------------------------------------------------//
    return
    #238810 quote
    Maricarmen
    Participant
    New

    Buenas Ivan;

    Muchísimas  Gracias de nuevo, muy buen trabajo.

    Se nota en el foro que hay una dinámica distinta desde tu incorporación.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Conversión Pivot Points


Soporte ProBuilder

New Reply
Author
author-avatar
Maricarmen @maricarmen Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Maricarmen
1 year, 3 months ago.

Topic Details
Forum: Soporte ProBuilder
Language: Spanish
Started: 10/09/2024
Status: Active
Attachments: No files
Logo Logo
Loading...