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 and other script

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

    CrossAbove and other script

    Why is it that this code does not work.
    (myTSF works OK)

    private BoolSeries CxTSFup;
    CxTSFup = new BoolSeries(this); // Close crosses above TSF
    CxTSFup.Set(Close[1] < myTSF[1] && Close[0] > myTSF[0]);
    if (CxTSFup[0])
    When this code snippet is active, it compiles OK, but produces a blank pane,

    but, when I use
    if (CrossAbove(Close, myTSF, 1))
    the code produces the expected output.
    Thank you
    Old hiker
    Last edited by oldhiker; 12-29-2011, 10:06 PM.

    #2
    Originally posted by oldhiker View Post
    Why is it that this code does not work.
    (myTSF works OK)

    private BoolSeries CxTSFup;
    CxTSFup = new BoolSeries(this); // Close crosses above TSF
    CxTSFup.Set(Close[1] < myTSF[1] && Close[0] > myTSF[0]);
    if (CxTSFup[0])
    When this code snippet is active, it compiles OK, but produces a blank pane,

    but, when I use
    if (CrossAbove(Close, myTSF, 1))
    the code produces the expected output.
    Thank you
    Old hiker
    What message is on your log when you get the blank chart?

    Comment


      #3
      Hello koganam,
      Thank you for your speedy reply, The error log is as follows;-
      Error on calling 'OnBarUpdate' method for indicator 'MyComboLong' on bar 0. You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series[barsAgo] with a value of 5 when there are only 4 bars on the chart.
      I do not understand this error message, as there are plenty of bars loaded (standard loading)
      Would it have any connection to another indicator that uses the same script?
      Thank you,
      Old Hiker

      Comment


        #4
        I would suggest that you look at my response in this thread.

        ref: http://www.ninjatrader.com/support/forum/showthread.php?t=41781

        Comment


          #5
          Thanks Koganam.

          Sample can be provided here as well.



          Let me know if I can be of further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          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
          5 views
          0 likes
          Last Post FAQtrader  
          Started by rocketman7, Today, 09:41 AM
          5 responses
          18 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frslvr, 04-11-2024, 07:26 AM
          9 responses
          127 views
          1 like
          Last Post caryc123  
          Started by selu72, Today, 02:01 PM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_Zachary  
          Working...
          X