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 andrewtrades, Today, 04:57 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      6 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      7 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X