ATR/VWAP Indicator code

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #244849 quote
    efahmyefahmy
    Participant
    Average

    anyone can help in fixing this code for the indicator below?

    DEFPARAM PreloadBars = 1000
    
    // --- PARAMETERS ---
    ATRPeriod = 14
    ATRMultiplier = 2
    VolumeThreshold = Average[50](Volume) * 2
    
    // --- INDICATORS ---
    ATRValue = ATR[ATRPeriod]
    ATRExplosion = ATRValue > ATRMultiplier * ATR[5]
    VWAPValue = VWAP
    
    // --- PRICE MOVEMENT DETECTION ---
    BullishMove = Close > VWAPValue AND ATRExplosion AND Volume > VolumeThreshold
    BearishMove = Close < VWAPValue AND ATRExplosion AND Volume > VolumeThreshold
    
    // --- TRIGGER SIGNALS ---
    IF BullishMove THEN
    DRAWARROWUP(LOW, "Strong Bullish Move", blue)
    ENDIF
    
    IF BearishMove THEN
    DRAWARROWDOWN(HIGH, "Strong Bearish Move", red)
    ENDIF
    #244853 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Hi! here it is

    // --- PARAMETERS ---
    ATRPeriod = 14
    ATRMultiplier = 1
    VolumeThreshold = Average[50](Volume) * 2
    
    // --- INDICATORS ---
    ATRValue = averagetruerange[ATRPeriod](close)
    ATRExplosion = ATRValue > ATRMultiplier * averagetruerange[5](close)
    
    if day<>day[1] then
    d=1
    VWAP=typicalprice
    else
    d=d+1
    if volume > 0 then
    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
    endif
    endif
    VWAPValue = VWAP
    
    // --- PRICE MOVEMENT DETECTION ---
    BullishMove = Close > VWAPValue AND ATRExplosion AND Volume > VolumeThreshold
    BearishMove = Close < VWAPValue AND ATRExplosion AND Volume > VolumeThreshold
    
    // --- TRIGGER SIGNALS ---
    IF BullishMove THEN
    DRAWARROWUP(barindex,LOW)coloured("blue")//, "Strong Bullish Move", blue)
    ENDIF
    
    IF BearishMove THEN
    DRAWARROWDOWN(barindex,HIGH)coloured("red")//, "Strong Bearish Move", red)
    ENDIF
    
    return VWAPValue
    #244855 quote
    efahmyefahmy
    Participant
    Average

    Thanks mate,

    could change it to paint bars with dark green and dark red instead of arrows?

    #244856 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Just change it for this:

    drawcandle(open,high,low,close)coloured("darkgreen")

    The same for darkred colour.

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

ATR/VWAP Indicator code


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
efahmy @efahmy Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by Iván GonzálezIván González
1 year, 6 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/12/2025
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...