Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Swing parameters

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

    #16
    Now your feeding in BarsArray1? What is the primary and what is the secondary bar series?

    Could be something to do with the MTF and its actually running on a secondary series you're not charting? Or are you?

    As far as checking how many bars back that swing low is you could do something simpler such as when the value changes mark that bar as the start of a new swing by storing "CurrentBar" into some variable. Then check against that variable versus current bar to see how many bars has passed since it was set?

    If still running into issue only thing you would be able to do is to take a look at the script running out of idea's with the information provided so far.
    BrettNinjaTrader Product Management

    Comment


      #17
      It's actually BarsArray[0] that I'm using in the script, not sure why I have been putting [1] on here, typo. Either way Primary is 5min, Secondary 1min. I looked at the 1min chart and it doesn't correspond to the swinglows there either. It's seem like the BarsArray is not functioning. I am using BIP == 1 because I want the trade to trigger off the 1min so that's why I was using BarsArray within Swing to make sure the swing is based off the 5min bars.

      How would I go about checking that the value changes? I assume you mean the value of the swinglow.

      Comment


        #18
        Hello,

        If you take away the secondary series and just run it on the primary does it work now or still no go? If still no go then I needed the script and settings so I could test on my side.
        BrettNinjaTrader Product Management

        Comment


          #19
          Also, you could track it manually via storing the last swing high/low price in some variable and checking on each new bar that the value is == to that. If it is != to that then it is a new swing low and you could then update that variable and then store that bar number in a variable. This is how you would track it manually.

          Note: However the swing indicator is a redrawing indicator which means as new data comes in the swing indicator will correct itself in historical. This is why its better to use the methods in the help guide versus tracking yourself due to this. (Unless you didn't want the redrawn values.). Swing indicator is one of the few indicators in NinjaTrader that do this.
          BrettNinjaTrader Product Management

          Comment


            #20
            I believe I tried changing the BIP to 0 the other day and it did work properly. But I need to have the secondary in there.

            Also BarsArray and BIP 1 works with the Value Syntax script so it seems like the issue is specific to the Bars Ago Syntax script. Maybe something to do with adding Math.Max is making it malfunction.

            I kind of give up on the Bars Ago Syntax. How would I go about checking that the value changes as you mentioned before? Then I will use CurrentBar to store.
            Last edited by zachj; 12-27-2013, 02:05 PM.

            Comment


              #21
              I gave it a try but I don't think I'm even close.

              The condition is if the recent 5min SwingLow[0] is above the previous SwingLow[10] and also less than .15 above previous swing than looking to store the current bar. Then I don't want it triggering a trade more than 2 bars past that stored bar. I'm getting so crazy trades though.

              if(Swing(BarsArray[0], 3).SwingLow[0] < Swing(BarsArray[0], 3).SwingLow[10] + .15 && Swing(BarsArray[0], 3).SwingLow[0] > Swing(BarsArray[0], 3).SwingLow[10])
              mySwing = CurrentBar;
              int barsSinceSwing = CurrentBar - mySwing;
              if(barsSinceSwing < 3)

              Comment


                #22
                Hello,

                Sorry for the delay on this replay.

                Without analyzing what you're seeing exactly I think you may be running into the limits of the swing indicator. This is a common theme of this indicator when used in strategies when getting weird results. As this indicator redraws previous values as it builds into the future. Which means you may get a signal, act on that signal on bar 100. Then at bar 105 the indicator has redrawin the past results and removed the signal at bar 100. So then when you look at the chart at bar 105 the result you see at bar 100 seems weird and strange.

                Swing and doncian channel are a couple of the only indicators that NinjaTrader ships with that redraw themselves.

                If you believe this is not what your running into if you can provide a simple backtest/strategy to support at ninjatrader dot com for me to analyzer the trade with what is expected vs what happens I would be able to give you a concrete answer.
                BrettNinjaTrader Product Management

                Comment


                  #23
                  I think I will just stay clear of the pivots, at least in the way I'm attempting to use them here. Thanks for the explanation. I was really just attempting to find some double bottoms or slightly higher lows.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  558 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  324 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  545 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  547 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X