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 kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    59 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    41 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    46 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    37 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    157 views
    0 likes
    Last Post SalmaTrader  
    Working...
    X