Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get the Highbar and Lowbar value of Swing indicator

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

    How to get the Highbar and Lowbar value of Swing indicator

    I am trying to use the following codes to get the Highbar and Lowbar value of Swing indicator but the returned value isn't right. What is the best way to get the most recent Highbar and Lowbar price value from the current bar.

    swingHigh = High[Math.Max(0, Swing(5).SwingHighBar(0, 1, 5))];
    swingLow = Low[Math.Max(0, Swing(5).SwingLowBar(0, 1, 5))];

    Print(string.Format("{0}| {1} {2} C:{3:0.00} O:{4:0.00} H:{5:0.00} L{6:0.00} RB:{7:0.00} upperS:{8:0.00} lowerS:{9:0.00} swingH:{10:0.00} SwingL:{11:0.00} ",
    Time[0], pattern, barPattern, close, open, high, low, realbody, upperShadow, lowerShadow, swingHigh, swingLow));​

    #2
    Hello sysmatrix,

    To use those methods you would call them similar to how you are, the swing would need to be within 5 bars with that lookback period. If you need to you can increase the lookback period to include enough bars to include the swing.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X