Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to say that something had happened on a High/Low of a bar?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to say that something had happened on a High/Low of a bar?

    Hello,

    how can I create a condition where I would like to find if something had happened on a Low or High of a bar? Would it differ when calculating OnBarClose and OnEachTick?

    Thank you

    #2
    Hello emuns,

    Thank you for your post.

    Current High and Low values for the currently forming bar can be accessed with High[0] and Low[0]. If you're calculating OnEachTick, these values will be updated in real time as new highs or lows are reached by the bar. Calculating OnBarClose means that these will return the final high and low for the bar and won't update intrabar.

    I'm not sure what you mean when you mean when you say find if something happened on the high or low of a bar. Could you be more specific about what you're trying to do?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Hello Kate,

      sorry. I´m trying to create Unfinished auction indicator. Start seems to be clear:

      long askVolume = barsType.Volumes[CurrentBar].GetAskVolumeForPrice(Close[0]);
      long bidVolume = barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Close[0]);

      if(askVolume > 0 && bidVolume > 0)

      ...but how to say that I mean ask and bid volume on a high or low of a bar?

      Thanks in advance,
      emuns

      Comment


        #4
        Hello emuns,

        Thank you for your reply.

        If you mean you want the volumes for the high price and the low price, you'd want to probably do this on bar close, but I'm not sure how you're wanting to use this exactly.

        GetAskVolumeForPrice and GetBidVolumeForPrice will get the volumes for a specific price. So, to get the ask volume at the high, you'd use

        long askVolume = barsType.Volumes[CurrentBar].GetAskVolumeForPrice(High[0]);

        If you wanted the volume for the low, you'd replace High[0] with Low[0].

        If you run this on each tick, you'll see the value of askVolume change as the volumes and high price changes. If you run it at the end of the bar, it'll give you the end result.

        Please let us know if we may be of further assistance to you.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        672 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X