Traduzione codice TW Power of ICT

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #252232 quote
    Msport71Msport71
    Participant
    Senior

    Buongiorno,

     

    sono davvero curioso di provare questo indicatore, basato sulla teoria di Wykoff.

     

    Grazie per l’aiuto.

    https://it.tradingview.com/script/5thZ7SVC-Power-Of-3-ICT-01-TradingFinder-AMD-ICT-SMC-Accumulations/

    // This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
    // © TFlab
    //@version=5

    indicator(“Power Of 3 ICT 01 [TradingFinder] AMD ICT & SMC Accumulations”, “TFlab AMD”, overlay = true, max_bars_back = 5000, max_boxes_count = 500,max_labels_count = 500,max_lines_count = 500)

    // Accumulation
    show_Accumulation = input(true, ‘Accumulation ‘, group = ‘Accumulation ‘)
    Accumulation_ses = input.session(‘1900-0100’, ”, inline = ‘Accumulation’, group = ‘Accumulation ‘)
    Accumulation_color = input.color(#8bbcfc, ‘Color’, inline = ‘Accumulation’, group = ‘Accumulation ‘)
    Accumulation_text = ‘Accumulation’

    // Manipulation
    show_Manipulation = input(true, ‘Manipulation ‘, group = ‘Manipulation ‘)
    Manipulation_ses = input.session(‘0100-0700’, ”, inline = ‘Manipulation’, group = ‘Manipulation ‘)
    Manipulation_color = input.color(#F0B884, ‘Color’, inline = ‘Manipulation’, group = ‘Manipulation ‘)
    Manipulation_text = ‘Manipulation’

    // Distribution
    show_Distribution = input(true, ‘Distribution ‘, group = ‘Distribution ‘)
    Distribution_ses = input.session(‘0700-1300’, ”, inline = ‘Distribution’, group = ‘Distribution ‘)
    Distribution_color = input.color(#0CC1C0, ‘Color’, inline = ‘Distribution’, group = ‘Distribution ‘)
    Distribution_text = ‘Distribution’

    //zones
    On_Accumulation = math.sign(nz(time(timeframe.period, Accumulation_ses, “America/New_York”)))
    On_Manipulation = math.sign(nz(time(timeframe.period, Manipulation_ses, “America/New_York”)))
    On_Distribution = math.sign(nz(time(timeframe.period, Distribution_ses, “America/New_York”)))

     

    //High & Low Detector
    LowHighDetector(On, Color, Text) =>
    var int Bar = 0
    var float High = 0.0
    var float Low = 0.0
    var box BoX = na
    var line H_Line = na
    var line L_Line = na
    var label LabeL = na
    var bool Permit = false
    if (On[1] == 0 and On == 1)
    Bar := bar_index
    High := high
    Low := low

    else
    if On[1] == 1 or On == 1
    High := math.max(high , High)
    Low := math.min(low , Low)

    if On > On[1] and str.tonumber(timeframe.period) <= 60
    BoX := box.new(bar_index,High, bar_index , Low, bgcolor = color.new(Color, 85),
    border_color = color.rgb(34, 101, 155),
    border_style = line.style_dotted)

    LabeL := label.new(int(math.avg(Bar,bar_index)), High , text = Text ,xloc = xloc.bar_index, yloc = yloc.price, size = size.normal ,
    style = label.style_label_down , textcolor = color.rgb(34, 101, 155), color = color.rgb(255, 255, 255, 100))
    if On[1] == 1 or On == 1
    box.set_top(BoX, High)
    box.set_bottom(BoX, Low)
    box.set_right(BoX, bar_index)
    label.set_x(LabeL,math.round(math.avg(Bar,bar_index)))
    label.set_y(LabeL, High)

     

    if show_Accumulation
    LowHighDetector(On_Accumulation, Accumulation_color,Accumulation_text)

    if show_Manipulation
    LowHighDetector(On_Manipulation,Manipulation_color,Manipulation_text)

    if show_Distribution
    LowHighDetector(On_Distribution,Distribution_color,Distribution_text)

    Screenshot-2025-10-07-at-09-49-31-Power-Of-3-ICT-01-TradingFinder-AMD-ICT-SMC-Accumulations-—-Indicatore-di-TFlab-—-TradingView.png Screenshot-2025-10-07-at-09-49-31-Power-Of-3-ICT-01-TradingFinder-AMD-ICT-SMC-Accumulations-—-Indicatore-di-TFlab-—-TradingView.png
    #252455 quote
    Iván GonzálezIván González
    Moderator
    Legend

    ecco

    // ============================================================
    // PRC_Power Of 3 ICT AMD [TradingFinder]
    // version = 1
    // 10.10.2025
    // Iván González @ www.prorealcode.com
    // Sharing ProRealTime knowledge
    // Traducido y adaptado por ProRealTime GEM
    // ============================================================
    
    // ==================== PARÁMETROS DE USUARIO =================
    // --- Controles Generales ---
    // IMPORTANTE: Ajusta este valor según la diferencia horaria entre el servidor de tu broker y Nueva York (EST/EDT).
    // Ejemplos:
    // - Servidor en Europa (CET/CEST, UTC+1/UTC+2) y NY (UTC-5/UTC-4) -> El offset es -6 o -7. Prueba con -6.
    // - Servidor en Londres (UTC/UTC+1) y NY -> El offset es -5.
    TimeZoneOffset = -6 // Horas de diferencia (Broker Time - NY Time)
    
    // --- Sesión de Acumulación ---
    showAccumulation = 1 // 1=Sí, 0=No
    AccumulationStart = 190000 // Hora de inicio (formato HHMM)
    AccumulationEnd = 010000 // Hora de finalización (formato HHMM)
    
    // --- Sesión de Manipulación ---
    showManipulation = 1 // 1=Sí, 0=No
    ManipulationStart = 010000
    ManipulationEnd = 070000
    
    // --- Sesión de Distribución ---
    showDistribution = 1 // 1=Sí, 0=No
    DistributionStart = 070000
    DistributionEnd = 130000
    
    // ==================== LÓGICA DE SESIONES HORARIAS =================
    // Detectamos si estamos dentro de cada sesión
    inAccumulation = (opentime >= AccumulationStart OR opentime < AccumulationEnd) AND showAccumulation
    inManipulation = (opentime >= ManipulationStart AND opentime < ManipulationEnd) AND showManipulation
    inDistribution = (opentime >= DistributionStart AND opentime < DistributionEnd) AND showDistribution
    
    // ==================== DETECTOR DE ALTOS Y BAJOS DE SESIÓN =================
    
    // --- Lógica para Acumulación ---
    ONCE startBarA = -1
    ONCE sessionHighA = 0
    ONCE sessionLowA = 0
    
    IF inAccumulation AND NOT inAccumulation[1] THEN // Primera barra de la sesión
       startBarA = barindex
       sessionHighA = high
       sessionLowA = low
    ELSIF inAccumulation THEN // Barras dentro de la sesión
       sessionHighA = MAX(sessionHighA, high)
       sessionLowA = MIN(sessionLowA, low)
    ELSIF NOT inAccumulation AND inAccumulation[1] THEN // Primera barra DESPUÉS de la sesión
       endBarA = barindex - 1
       midBarA = round((startBarA + endBarA) / 2)
       DRAWRECTANGLE(startBarA, sessionHighA, endBarA, sessionLowA) COLOURED(139,188,252) fillCOLOR(139,188,252,30)
       DRAWTEXT("Accumulation", midBarA, sessionHighA + 0.5*averagetruerange[14](close))
       startBarA = -1 // Reiniciar para el próximo ciclo
    ENDIF
    
    // --- Lógica para Manipulación ---
    ONCE startBarM = -1
    ONCE sessionHighM = 0
    ONCE sessionLowM = 0
    
    IF inManipulation AND NOT inManipulation[1] THEN
       startBarM = barindex
       sessionHighM = high
       sessionLowM = low
    ELSIF inManipulation THEN
       sessionHighM = MAX(sessionHighM, high)
       sessionLowM = MIN(sessionLowM, low)
    ELSIF NOT inManipulation AND inManipulation[1] THEN
       endBarM = barindex - 1
       midBarM = round((startBarM + endBarM) / 2)
       DRAWRECTANGLE(startBarM, sessionHighM, endBarM, sessionLowM) COLOURED(240,184,132) fillCOLOR(240,184,132,30)
       DRAWTEXT("Manipulation", midBarM, sessionHighM + 0.5*averagetruerange[14](close))
       startBarM = -1
    ENDIF
    
    // --- Lógica para Distribución ---
    ONCE startBarD = -1
    ONCE sessionHighD = 0
    ONCE sessionLowD = 0
    
    IF inDistribution AND NOT inDistribution[1] THEN
       startBarD = barindex
       sessionHighD = high
       sessionLowD = low
    ELSIF inDistribution THEN
       sessionHighD = MAX(sessionHighD, high)
       sessionLowD = MIN(sessionLowD, low)
    ELSIF NOT inDistribution AND inDistribution[1] THEN
       endBarD = barindex - 1
       midBarD = round((startBarD + endBarD) / 2)
       DRAWRECTANGLE(startBarD, sessionHighD, endBarD, sessionLowD) COLOURED(12,193,192) FILLCOLOR(12,193,192,30)
       DRAWTEXT("Distribution", midBarD, sessionHighD + 0.5*averagetruerange[14](close))
       startBarD = -1
    ENDIF
    
    RETURN
    
    Msport71 thanked this post
    #252462 quote
    Msport71Msport71
    Participant
    Senior

    Grazie e buon week end!

Viewing 3 posts - 1 through 3 (of 3 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

Traduzione codice TW Power of ICT


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
Msport71 @carlo-pasca Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Msport71Msport71
11 months, 1 week ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 10/07/2025
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...