traduzione codice TW Swing High /Low detector

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #237698 quote
    Msport71
    Participant
    Junior

    Buongiorno,

     

    potete gentilmente tradurre il codice in oggetto; vorrei testarlo su vari timeframe per vedere come utilizzarlo.

     

    Grazie per l’aiuto.

    https://it.tradingview.com/script/hvkgnzWv-ICT-Swing-High-Low-Detector/

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

    //@version=5
    indicator(“ICT Swing High/Low Detector”, overlay=true)

    // Function to detect swing low
    swingLow() =>
    low1 = low[3]
    low2 = low[2]
    low3 = low[1]
    high4 = high[0]
    isSwingLow = low2 < low1 and low3 > low2 and high4 > high[1]
    isSwingLow

    // Function to detect swing high
    swingHigh() =>
    high1 = high[3]
    high2 = high[2]
    high3 = high[1]
    low4 = low[0]
    isSwingHigh = high2 > high1 and high3 < high2 and low4 < low[1]
    isSwingHigh

    // Detect swing points with fourth candle confirmation
    swingLowDetected = swingLow() and high > high[1]
    swingHighDetected = swingHigh() and low < low[1]

    // Plot swing points
    plotshape(swingLowDetected, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small)
    plotshape(swingHighDetected, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)

    // Add labels
    if swingLowDetected
    label.new(bar_index[1], low[2], “SL”, color=color.green, style=label.style_label_up, size=size.tiny)
    if swingHighDetected
    label.new(bar_index[1], high[2], “SH”, color=color.red, style=label.style_label_down, size=size.tiny)

    #237864 quote
    Iván González
    Moderator
    Master

    Ecco qui:

    //---------------------------------------//
    //PRC_ICT Swing High/Low Detector
    //version = 0
    //20.09.2024
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    //---------------------------------------//
    //----Function to detect swing low-------//
    //---------------------------------------//
    isSwingLow = low[2]<low[3] and low[1]>low[2]
    //---------------------------------------//
    //----Function to detect swing High------//
    //---------------------------------------//
    isSwingHigh = high[2]>high[3] and high[1]<high[2] 
    //---------------------------------------//
    //--------Detect swing points------------//
    //---------------------------------------//
    swingLowDetected=isSwingLow and high>high[1]
    swingHighDetected=isSwingHigh and low<low[1]
    //---------------------------------------//
    //--------Plot swing points--------------//
    //---------------------------------------//
    if swingLowDetected then
    drawtext("▲",barindex,low) coloured("green")
    drawtext("SL",barindex[2],low[2]) coloured("green")
    elsif swingHighDetected then
    drawtext("▼",barindex,high) coloured("red")
    drawtext("SH",barindex[2],high[2]) coloured("red")
    endif
    //---------------------------------------//
    return
    #237868 quote
    Msport71
    Participant
    Junior

    Grazie, gentilissimo!

    #237925 quote
    Ciccarelli Franco
    Participant
    Junior

    Quale il significato dei colori e grandezza dei pallini?

    Grazie

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

traduzione codice TW Swing High /Low detector


ProBuilder: Indicatori & Strumenti Personalizzati

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

This topic contains 3 replies,
has 3 voices, and was last updated by Ciccarelli Franco
1 year, 4 months ago.

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 09/17/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...