Announcement

Collapse
No announcement yet.

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.
          BrettNinjaTrader Product Management

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          571 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          330 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          548 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          549 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X