CONVERSION INDICADOR TRADINGVIEW:”Estructura del mercado Trailing Stop “

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #237047 quote
    Fr7Fr7
    Participant
    Master

    Solicito, si es posible, convertir el indicador adjunto:

    El indicador de stop dinámico de estructura de mercado es una herramienta avanzada para identificar cambios en la estructura del mercado, barridos de liquidez y posibles reversiones de tendencia mediante un análisis de volumen integral. Este indicador combina el análisis de los pivotes de la estructura del mercado (CHoCH – Cambio de carácter) con una lógica sofisticada de stop dinámico basada en el volumen. Al evaluar el volumen delta en puntos estructurales clave, permite a los operadores identificar continuaciones o reversiones de tendencia de alta probabilidad y administrar sus operaciones de manera más efectiva.

    https://es.tradingview.com/script/DFdFfl7t-Market-Structure-Trailing-Stop-BigBeluga/

    A ver si Iván el moderador tiene un hueco libre y lo puede traducir.
    Muchas gracias.

    #237963 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Buenas!
    Aquí tienes el indicador:

    //------------------------------------//
    //PRC_Market Structure Trailing Stop
    //version = 0
    //24.09.24
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //------------------------------------//
    //-----Inputs-------------------------//
    //------------------------------------//
    leftbars=8
    rightbars=leftbars
    useTS=1
    trailLen=25 //Trailing stop
    volumeThreshold=500
    useBos=1
    sweepX=1
    trendCol=1
    //------------------------------------//
    // Pivot Highs and Pivot Lows
    //------------------------------------//
    src1 = low//min(open,close)
    src2 = high//max(open,close)
    //Pivots Low
    if src1 > src1[rightbars] and lowest[rightbars](src1) > src1[rightbars] and src1[rightbars] < lowest[leftbars](src1)[rightbars+1] then
    $ply[z+1] = src1[rightbars]
    $plx[z+1] = barindex[rightbars]
    checkdw=0
    drawpoint(barindex[rightbars],src1[rightbars],2)coloured("red",80)
    z = z + 1
    endif
    //Pivots High
    if src2 < src2[rightbars] and highest[rightbars](src2)<src2[rightbars] and src2[rightbars]>highest[leftbars](src2)[rightbars+1] then
    $phy[t+1]=src2[rightbars]
    $phx[t+1]=barindex[rightbars]
    checkup=0
    drawpoint(barindex[rightbars],src2[rightbars],2)coloured("blue",80)
    t=t+1
    endif
    //------------------------------------//
    //----------Pivot lines---------------//
    //------------------------------------//
    if t>0 and z>0 then
    //---Market Structure Logic for Higher pivots
    if high>$phy[t] and low<$phy[t] and checkup=0 then
    checkup=1
    count1=count1+1
    count2=0
    n1=$phx[t]
    
    if count1=1 then
    volume1=0
    for i=0 to barindex-n1 do
    if close[i]>open[i] then
    volume1=volume1+volume[i]
    else
    volume1=volume1-volume[i]
    endif
    next
    drawsegment($phx[t],$phy[t],barindex,$phy[t])coloured("green")
    drawtext("CHoCh/#volume1#",(barindex+$phx[t])/2,$phy[t]+0.1*tr)
    endif
    if count1>1 and useBos then
    myindex=barindex-(barindex-n1)/2
    volume1=0
    for i=0 to barindex-n1 do
    if close[i]>open[i] then
    volume1=volume1+volume[i]
    else
    volume1=volume1-volume[i]
    endif
    next
    drawsegment($phx[t],$phy[t],barindex,$phy[t])coloured("green")
    if close<open and high>$phy[t] and open<$phy[t] and sweepX then
    drawtext("X/#volume1#",(barindex+$phx[t])/2,$phy[t]+0.1*tr)
    else
    drawtext("BOS/#volume1#",(barindex+$phx[t])/2,$phy[t]+0.1*tr)
    endif
    endif
    endif
    //---Market Structure Logic for Lower pivots
    if high > $ply[z] and low<$ply[z] and checkdw=0 then
    checkdw=1
    count2=count2+1
    count1=0
    n2=$plx[z]
    
    if count2=1 then
    volume2=0
    for i=0 to barindex-n2 do
    if close[i]>open[i] then
    volume2=volume2+volume[i]
    else
    volume2=volume2-volume[i]
    endif
    next
    drawsegment($plx[z],$ply[z],barindex,$ply[z])coloured("red")
    drawtext("CHoCh/#volume2#",(barindex+$plx[z])/2,$ply[z]-0.1*tr)
    endif
    if count2>1 and useBos then
    myindex2=barindex-(barindex-n2)/2
    volume2=0
    for i=0 to barindex-n2 do
    if close[i]>open[i] then
    volume2=volume2+volume[i]
    else
    volume2=volume2-volume[i]
    endif
    next
    drawsegment($plx[z],$ply[z],barindex,$ply[z])coloured("red")
    if close<open and low<$ply[z] and close>$ply[z] and sweepX  then
    drawtext("X/#volume2#",(barindex+$plx[z])/2,$ply[z]-0.1*tr)
    else
    drawtext("BOS/#volume2#",(barindex+$plx[z])/2,$ply[z]-0.1*tr)
    endif
    endif
    endif
    endif
    //------------------------------------//
    //-------Trend and Trail Stop---------//
    //------------------------------------//
    if count1>0 then
    countTrend2=0
    countTrend1=countTrend1+1
    elsif count2>0 then
    countTrend2=countTrend2+1
    countTrend1=0
    endif
    hi=highest[trailLen](high)
    lo=lowest[trailLen](low)
    
    if countTrend1>0 and lo[1]<=lo and lo[2]<=lo[1] and lo[3]<=lo[2] and lo[4]<=lo[3] and lo[5]<=lo[4] and volume1>volumeThreshold and useTs then
    band=lo
    up=up+1
    dw=0
    red=0
    green=125
    elsif countTrend2>0 and hi[1]>=hi and hi[2]>=hi[1] and hi[3]>=hi[2] and hi[4]>=hi[3] and hi[5]>=hi[4] and volume2<-volumeThreshold and useTS then
    band=hi
    up=0
    dw=dw+1
    red=255
    green=0
    else
    band=undefined
    dw=0
    up=0
    endif
    //------------------------------------//
    //-----------Plot Signals-------------//
    //------------------------------------//
    if useTs then
    if up=1 then
    drawtext("▲",barindex,band-0.1*tr)coloured("green")
    endif
    if dw=1 then
    drawtext("▼",barindex,band+0.1*tr)coloured("red")
    endif
    drawpoint(barindex,band,1)coloured(red,green,0)
    endif
    //------------------------------------//
    //-----------Color Candles------------//
    //------------------------------------//
    if trendCol then
    if countTrend1>0 then
    r1=0
    g1=255
    elsif countTrend2>0 then
    r1=255
    g1=0
    endif
    drawcandle(open,high,low,close)coloured(r1,g1,0)
    endif
    
    return 
    Fr7 thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

CONVERSION INDICADOR TRADINGVIEW:”Estructura del mercado Trailing Stop “


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
Fr7 @fr7 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván GonzálezIván González
1 year, 11 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 09/03/2024
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...