Help with Volume indicator

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #234838 quote
    Niklas87
    Participant
    New

    Im trying to make an Volume indicator that compare Volume on the current bar to the same bar the week before and one that compare to the same bar the day before, but im getting stuck and out off ideas.

    On a 10min graf i first try with Volume[0] – Volume[144], but since IG have trading for a few bars on sundays it all falls apart..

    On the 1Day graf i try with Volume-Volume[6], but have the same problem coz off holidays ect…

    I think i need to use Intradaybarindex for the intraday version and dayoffweek for the 1D version, but dont know how..

    Whant to be able to gett an SMA on the same data too (compare current day to a 5 or 10 day Average off that same bar/day).

    Thanks in andvance!

    #234867 quote
    Niklas87
    Participant
    New

    Found a sloution with ChatGPT using loops, so now it seems to work as intenden.

    But found another problem when trying on the 1 day graf:

    When i use DayOffWeek = 5 it counts both thursday and friday but DayOffWeek = 1 gives me sunday.

    What is the reason for this?

     

    #234900 quote
    robertogozzi
    Moderator
    Master

    Because DayOfWeek is the day of the week when a candle closes, so on Thursday night it closes on Friday as well as on Friday because there’s no day after that.

    On Sunday, which is DayOfWeek 0, it returns 1 because the sunday candle closes on Monday.

    Use OpenDayOfWeek instead, which is the day of the week when a candle opens.

    Niklas87 and Iván González thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Help with Volume indicator


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Niklas87 @niklas87 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by robertogozzi
1 year, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 07/06/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...