Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicators

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

    Indicators

    I have built custom indicators which seemed to work fine in 6.5

    I am having problems with the indicators in version 7
    I log into Ninja 7 and some of the indicators are not working
    I close the chart and reload a new chart and the indicators work

    During the day the indictors do not work properly
    I have to keep reloading historical data to get then to work properly
    Yesterday I hit reload histrical data so often that the indicators were totally confused I had to reload a new chart twice to get them to work properly

    I question why the indicators work when I open a new chart but not during trading

    #2
    rbt297, are you using the latest NT 7 beta version 10?

    Are you spotting any errors in the log tab as this happens?

    Depending on methods used, these scripts will need updating to reflect changes made to NinjaScript with 7's arrival -

    Contains critical information including but not limited to migration, installation, connections and changes.

    Comment


      #3
      Errors in log

      Yes I keep getting the same error in the logs

      The error is listed as follows:

      Error on calling On Bar Update method for indicator on Bar 1
      You are accessing an index with a value that is invalid since its out of range

      IE: accessing a series [Bars ago] with a value of 5 when there are only 4 bars on the chart

      ___________

      I have had this error 16 times since 7:37 this morning

      Ray T

      Comment


        #4
        Thanks, this would indicate you miss needed checks at your indicator's OnBarUpdate start as per here -

        Comment


          #5
          Code

          Hi Bertrand

          I have looked at that code change as you indicate

          I find that what I am using works on a 2 minute chart but not on a tick chart

          Is there a diference since tick charts are live data vs time charts

          The following is what we have coded which has been working with Ninja 7 2 minute chart but not tick chart using 100 tick data
          protected override void OnBarUpdate()
          {
          if (CurrentBar < 1)
          return;

          if ((Close[0] > SMA(High,20)[0]) &&

          (Close[1] > SMA(Low,20)[1]) &&


          (Close[1] < SMA(High,20)[1]) &&

          (Close[2] > SMA(Low,20)[2]) &&

          (Close[2] < SMA(High,20)[2]) &&

          (Close[3] < SMA(Low,20)[3]))


          DrawArrowUp(CurrentBar.ToString(), true, 0, Low[0] - TickSize, Color.Blue);

          Comment


            #6
            rbt297, the highest you reference back is 3 bars, so please work with a CurrentBar check that would reflect this -

            Code:
             
            protected override void OnBarUpdate()
            {
            if (CurrentBar < 3)
            return;
            
            if ((Close[0] > SMA(High,20)[0]) &&
            
            (Close[1] > SMA(Low,20)[1]) &&
            
            
            (Close[1] < SMA(High,20)[1]) &&
            
            (Close[2] > SMA(Low,20)[2]) &&
            
            (Close[2] < SMA(High,20)[2]) &&
            
            (Close[3] < SMA(Low,20)[3])) 
            
            
            DrawArrowUp(CurrentBar.ToString(), true, 0, Low[0] - TickSize, Color.Blue); 
            }

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            599 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            344 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            558 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            557 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X