VWAP Daily coding

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

    How I can code if the price greater or less than VWAP??

    #175218 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    //VWAP calculation
    //
    NoSunday = 0            //1=skip Sunday's
    IF (BarIndex = 0) OR (OpenDay <> OpenDay[1]) THEN
       SumVolPrice = 0
       SumVol      = 0
    ENDIF
    IF Volume > 0 THEN
       IF (OpenDayOfWeek <> 0) OR (OpenDayOfWeek = 0 AND Not NoSunday) THEN
          SumVolPrice = SumVolPrice + (Volume * close)
          SumVol      = SumVol      + Volume
          VWAP        = SumVolPrice / SumVol
       ENDIF
    ENDIF
    Cond = (close > VWAP) + ((close < VWAP) * -1) //1=above  -1=below
    efahmy, Midlanddave and eckaw 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

VWAP Daily coding


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
efahmy @efahmy Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
5 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/12/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...