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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    64 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    139 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X