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, 03-31-2026, 09:41 PM
    1 response
    47 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    23 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    33 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X