avg. Volume indicator for trading hours ONLY

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #111448 quote
    O-jay8
    Participant
    Veteran

    Hello everyone,
    I want to create an average volume indicator which only considers the volume of the trading hours and neglects the out of trading hours.
    In my opinion the out of trading hours delute the average.

    Conditions:
    1h timeframe
    trading hours 07:00 until 22:00
    lookback: last 10 bars

    Example A: it is 20:00 o’clock. The lookback 10 periods 10:00 – 20:00. Entire average[10] is in trading hours
    Example B: its 10:00 o’clock. 10 period lookback should be from 07:00 – 10:00 current day and 15:00 – 22:00 previous day.

    Is it possible to create an “While loop” or “for loop” instead of plenty “if-then” conditions?
    How do I achieve that in a code?
    Does anybody have an idea?

    Kind regards

    #111453 quote
    Vonasi
    Moderator
    Master

    Similar question to one I was helping with recently that can be found here:

    How to apply an indicator on day session only?

    Just change myIndicator from RSI to VOLUME.

    O-jay8 thanked this post
    #111537 quote
    O-jay8
    Participant
    Veteran

    Thanks a lot Vonasi for pointing me in the right direction.
    It helped me a great deal.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

avg. Volume indicator for trading hours ONLY


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
O-jay8 @o-jay8 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by O-jay8
6 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 10/28/2019
Status: Active
Attachments: No files
Logo Logo
Loading...