Zonas de Soporte y Resistencia

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

    Hola:

    Se podría hacer el Screener de este indicador pues me parece que para soportes da resultado, sin embargo en resistencias no lo veo muy claro y tengo  dudas, es el siguiente:

    // ———————————————–
    // PRC_Support and Resistance Power Channel [ChartPrime]
    //version = 0
    //07.10.2025
    //Iván González @ http://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

     

    Muchas gracias,

    #252380 quote
    Iván González
    Moderator
    Legend
    // -----------------------------------------------
    // SRC_Support and Resistance Power Channel
    //version = 0
    //09.10.2025
    //Iván González @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    // -----------------------------------------------
    // INPUTS
    // -----------------------------------------------
    length = 130
    // -----------------------------------------------
    // CALCULATION SUPPORT AND RESISTANCE AREA
    // -----------------------------------------------
    // ATR
    atr = AverageTrueRange[200] * 0.5
    // HIGHEST AND LOWEST PRICE
    maxVal = HIGHEST[length](high)
    minVal = LOWEST[length](low)
    
    topOfSupport = minVal + atr
    bottomOfSupport = minVal - atr
    topOfResistance = maxVal + atr
    bottomOfResistance = maxVal - atr
    
    setupResistance = high>bottomOfResistance and low<topOfResistance
    setupSupport = low<topOfSupport and high>bottomOfSupport
    // -----------------------------------------------
    // 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
    // -----------------------------------------------
    screener[setupSupport or setupResistance](setupResistance as "Res=1/Sup=0",buyPower as "BuyPower",sellPower as "SellPower")
    
    robertogozzi and Maricarmen 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

Zonas de Soporte y Resistencia


ProScreener: Buscadores de Mercado y Rastreo

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
11 months, 1 week ago.

Topic Details
Forum: ProScreener: Buscadores de Mercado y Rastreo
Language: Spanish
Started: 10/08/2025
Status: Active
Attachments: No files
Logo Logo
Loading...