Conversion de code pine script

Forums ProRealTime forum Français Support ProBuilder Conversion de code pine script

  • This topic has 1 reply, 2 voices, and was last updated 1 day ago by avatarIván.
Viewing 2 posts - 1 through 2 (of 2 total)
  • #241476

    Bonjour, pouvez-vous m’aider à convertir ce code pine script en Probuilder pour PRT ?

    //@version=3
    study(“HLC Trend”)

    // Pull traditional HLC
    sHigh = security(tickerid, period, high)
    sLow = security(tickerid, period, low)
    sClose = security(tickerid, period, close)
    sOpen = security(tickerid, period, open)

    // Inputs
    option_SMA = ‘SMA’, option_EMA = ‘EMA’, option_WMA = ‘WMA’

    length_Close = input(defval = 5, title = “Close MA Period Length”, type = integer)
    length_High = input(defval = 30, title = “High MA Period Length”, type = integer)
    length_Low = input(defval = 13, title = “Low MA Period Length”, type = integer)
    type_MA = input(defval = option_SMA, title = “Moving Average Type”, type = string, options = [option_SMA, option_EMA, option_WMA])
    fill_Cloud = input(defval = true, title = “Use cloud coloring for Bull/Bear identification?”, type = bool)
    fill_BG = input(defval = true, title = “Color Indicator background based on Bull/Bear/Neautral?”, type = bool)

    // Calculations
    ma_High = type_MA == option_SMA ? sma(sHigh, length_High) : type_MA == option_EMA ? ema(sHigh, length_High) : type_MA == option_WMA ? wma(sHigh, length_High) : sma(sHigh, length_High)
    ma_Low = type_MA == option_SMA ? sma(sLow, length_Low) : type_MA == option_EMA ? ema(sLow, length_Low) : type_MA == option_WMA ? wma(sLow, length_Low) : sma(sLow, length_Low)
    ma_Close = type_MA == option_SMA ? sma(sClose, length_Close) : type_MA == option_EMA ? ema(sClose, length_Close) : type_MA == option_WMA ? wma(sClose, length_Close) : sma(sClose, length_Close)
    ma_CH = ma_Close – ma_High
    ma_LC = ma_Low – ma_Close

    // Draw Colors
    fill_Color = ma_CH > ma_LC ? green : red
    bg_Color = ma_CH >= ma_LC ? ma_CH < 0 and ma_CH < ma_CH[1] ? yellow : green : ma_LC < 0 and ma_LC < ma_LC[1] ? yellow : red // Draw Out hline(0, color = white, title = "Zero Line") plot_CH = plot(ma_CH, color = green, transp = 0, title = "MA Close - MA High") plot_LC = plot(ma_LC, color = red, transp = 0, title = "MA Low - MA Close") bgcolor(fill_BG == true ? bg_Color : na, transp = 40, title = "Indicator Background Color") // Cloud fill selector fill_plot_CH = fill_Cloud == true ? ma_CH : na fill_plot_LC = fill_Cloud == true ? ma_LC : na cloud_plot_CH = plot(fill_plot_CH, transp = 100, title = "Hidden MA Close - MA High Cloud") cloud_plot_LC = plot(fill_plot_LC, transp = 100, title = "Hidden MA Low - MA Close Cloud") fill(cloud_plot_CH, cloud_plot_LC, color = fill_Color, transp = 40, title = "Cloud Color") // END Cloud fill selector

    #241500

    Voici ce que vous avez :

    1 user thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

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