Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

tracking swings in a strategy

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

    tracking swings in a strategy

    So i am trying to track recent swings on a chart and struggling a bit. What I have below should grab how many bars back each swing was. But I am not sure how to get the price of each of these swings. How would I go about that?

    Code:
    mySwingHighBar = Swing(PivotStrength).SwingHighBar(RangeLookback, 1, PivotStrength);
    mySwingLowBar = Swing(PivotStrength).SwingLowBar(RangeLookback, 1, PivotStrength);​​











    #2
    Hello wobmon,

    Welcome to the NinjaTrader forums!

    Print("The high of the swing bar is " + High[Math.Max(0, Swing(PivotStrength).SwingHighBar(RangeLookback, 1, PivotStrength))]);​
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    113 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    60 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    40 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    43 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    81 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X