Sliding VWAP code

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

    Hi,

    I have found code of VWAP for intraday with a starting time, but I am unable to amend it to get a sliding VWAP as per the attached snapshot.

    Is it possible to compute something like?

    // VWAP Computation
    Timestart=Time-010000
    if time=Timestart then
    d=0
    
    else
    d=d+1
    if volume >0 then
    VWAP = SUMMATION[d](volume*typicalprice)/SUMMATION[d](volume)
    endif
    endif
    
    

    Thanks for your help

    VWAP-configuration.png VWAP-configuration.png
    #220346 quote
    JSJS
    Participant
    Master

    Hi @KumoNoJuzza

    Try this one:

     

    SlidingPeriod = 120 //in minutes
    GTF = GetTimeFrame
    N = Round(SlidingPeriod / (GTF/60))
    
    VW = Close * Volume
    VolumeSum = Summation[N](Volume)
    VolumeWeightedSum = Summation[N](VW)
    
    VWAP = VolumeWeightedSum / VolumeSum
    
    Return VWAP Coloured("Red")
    KumoNoJuzza and Nicolas thanked this post
    Scherm­afbeelding-2023-09-05-om-08.03.35.png Scherm­afbeelding-2023-09-05-om-08.03.35.png
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

Sliding VWAP code


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JSJS
3 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/04/2023
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...