ATR/VWAP Indicator code

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #244849 quote
    efahmy
    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ález
    Moderator
    Master

    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
    efahmy
    Participant
    Average

    Thanks mate,

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

    #244856 quote
    Iván González
    Moderator
    Master

    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.

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ález
11 months, 3 weeks ago.

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