Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 The_Sec, Yesterday, 03:37 PM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by vecnopus, Today, 06:15 AM
      0 responses
      1 view
      0 likes
      Last Post vecnopus  
      Started by Aviram Y, Today, 05:29 AM
      0 responses
      5 views
      0 likes
      Last Post Aviram Y  
      Started by quantismo, 04-17-2024, 05:13 PM
      3 responses
      27 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by ScottWalsh, 04-16-2024, 04:29 PM
      7 responses
      36 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X