Zonas de Soporte y Resistencia

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

    Buenas Tardes:

    Sería posible traducir este indicador, pues me gustaría probarlo para ver que es lo que da de si.

    https://www.tradingview.com/script/6WDeQiyp-Support-and-Resistance-Power-Channel-ChartPrime/

    Muchas gracias,

    #252264 quote
    Iván González
    Moderator
    Master

    buenas tardes
    Aquí tienes:

    // -----------------------------------------------
    // PRC_Support and Resistance Power Channel [ChartPrime]
    //version = 0
    //07.10.2025
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    // -----------------------------------------------
    // INPUTS
    // -----------------------------------------------
    DEFPARAM DRAWONLASTBARONLY = true
    length = 130
    extend = 30
    // COLOURS
    tcolR = 255
    tcolG = 0
    tcolB = 255
    bcolR = 0
    bcolG = 255
    bcolB = 0
    alpha = 60
    // -----------------------------------------------
    // CALCULATION SUPPORT AND RESISTANCE AREA
    // -----------------------------------------------
    // ATR
    atr = AverageTrueRange[200] * 0.5
    // HIGHEST AND LOWEST PRICE
    maxVal = HIGHEST[length](high)
    minVal = LOWEST[length](low)
    midVal = (maxVal + minVal) / 2
    // -----------------------------------------------
    // DRAW SUPPORT AND RESISTANCE AREA
    // -----------------------------------------------
    if islastbarupdate then
       maxOffset = barssince(high=maxVal)
       minOffset = barssince(low=minVal)
       // RESISTANCE AREA
       DRAWRECTANGLE(barindex - length, maxVal + atr, barindex + extend, maxVal - atr) fillcolor(tcolR, tcolG, tcolB, alpha)COLOURED(tcolR, tcolG, tcolB,0)
       DRAWSEGMENT(barindex - length, maxVal + atr, barindex + extend + 30, maxVal + atr) COLOURED(tcolR, tcolG, tcolB)
       DRAWTEXT("▲ #maxVal#", barindex + extend + 10, maxVal)
       
       // SUPPORT AREA
       DRAWRECTANGLE(barindex - length, minVal + atr, barindex + extend, minVal - atr) fillcolor(bcolR, bcolG, bcolB, alpha)COLOURED(bcolR, bcolG, bcolB, 0)
       DRAWSEGMENT(barindex - length, minVal - atr, barindex + extend + 30, minVal - atr) COLOURED(bcolR, bcolG, bcolB)
       DRAWTEXT("▼ #minVal#", barindex + extend + 10, minVal)
       
       // MIDDLE LINE
       DRAWSEGMENT(barindex - length, midVal, barindex + extend, midVal) COLOURED(128, 128, 128) STYLE(DOTTEDLINE, 1)
       DRAWTEXT("▶ #midVal#", barindex + extend + 10, midVal) COLOURED(128, 128, 128)
       
       // BUY AND SELL POWER
       buyPower = 0
       sellPower = 0
       
       FOR i = 0 TO length - 1 DO
          IF close[i] > open[i] THEN
             buyPower = buyPower + 1
          ELSIF close[i] < open[i] THEN
             sellPower = sellPower + 1
          ENDIF
       NEXT
       
       textPosX = barindex - length - extend
       DRAWTEXT("Sell Power: #sellpower#", textPosX, maxVal)
       DRAWTEXT("Buy Power: #buypower#", textPosX, minVal)
       
       // DRAW SUPPORT AND RESISTANCE TESTS
       topOfSupport = minVal + atr
       bottomOfResistance = maxVal - atr
       
       FOR i = 0 TO length - 1 DO
          IF low[i+1] <= topOfSupport AND low[i] > topOfSupport THEN
             DRAWARROWUP(barindex - i, minval - atr*1.5) COLOURED(bcolR, bcolG, bcolB)
          ENDIF
          IF high[i+1] >= bottomOfResistance AND high[i] < bottomOfResistance THEN
             DRAWARROWDOWN(barindex - i, maxval + 1.5*atr) COLOURED(tcolR, tcolG, tcolB)
          ENDIF
          if high[i]=maxval then
             drawpoint(barindex[i],maxval,3)coloured(tcolR, tcolG, tcolB)
          endif
          if low[i]=minval then
             drawpoint(barindex[i],minval,3)coloured(bcolR, bcolG, bcolB)
          endif
       NEXT
       
    endif
    
    return
    
    Maricarmen thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Zonas de Soporte y Resistencia


Soporte ProBuilder

New Reply
Author
author-avatar
Maricarmen @maricarmen Participant
Summary

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

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