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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      57 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      78 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      39 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      101 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      61 views
      0 likes
      Last Post PaulMohn  
      Working...
      X