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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    32 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    195 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    356 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    277 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X