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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      82 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      43 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      68 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      56 views
      0 likes
      Last Post CarlTrading  
      Working...
      X