Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CrossAbove & Below

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

    CrossAbove & Below

    NinjaSupport,

    I am trying to copy a couple of ThinkorSwim indicators I have over to NinjaTrader and I'm getting errors. Can you help me troubleshoot:


    Found answer:

    ThinkorSwim CrossAbove or CrossBelow is equivalent to "<" and ">" in NinjaTrader.
    Last edited by Blairski; 03-04-2018, 09:19 AM.

    #2
    Originally posted by Blairski View Post
    Current NinjaScript I have:
    if (CrossAbove(LinReg(12)[0], LinReg(12)[1],1))
    This logic is terribly suspect, are you sure you understand the intent of the original code?

    As written, this code (and your CrossBelow, as well) should fail to compile, since the first argument must be a Series.


    Comment


      #3
      Originally posted by Blairski View Post
      def runup = (LinearRegCurve(length = 9) crosses above LinearRegCurve(length = 9) from 1 bar ago);
      def rundown = (LinearRegCurve(length = 7) crosses below LinearRegCurve(length = 7) from 1 bar ago);
      I'm sure I don't understand this, but a LinReg(9) will never 'cross above' another LinReg(9) -- because these are the exact same lines.

      Same goes for the LinReg(7) -- it will never 'cross below' itself.

      Are you absolutely sure the ThinkScript was copied correctly?

      I'm not a ThinkScript expert, for ex, I don't know what "1 bar ago" means, or how it would affect the ability of LinReg(9) to cross above itself ...

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      596 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      554 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X