VWAP Daily coding

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

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

    #175218 quote
    robertogozzi
    Moderator
    Master

    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.

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 robertogozzi
4 years, 6 months ago.

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