Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on calling 'OnBarUpdate' method on bar 0.

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

    #16
    @s.kinra

    Thank you, all now is working as supposed to!

    Comment


      #17
      Errors were:

      1) Not setting "private Series<int> test;" before OnStateChange
      2) not setting "test = new Series<int>(this);" in State.Configure

      But now all works well, thank you s.kinra

      Comment


        #18
        This is how we initiate new variable data series without a plot for it, so it can be used for calculations.
        Glad to know it works!
        Last edited by s.kinra; 10-12-2020, 02:17 AM.

        Comment


          #19
          However. If I try calling Custom201010()[0] in a strategy, it gives Error on calling 'OnBarUpdate' method on bar 20: Index was outside the bounds of the array. error.

          My strategy starts with bar 20. How can this be solved?

          Comment


            #20
            If you need to use indicator in strategy you must define a plot in indicator so then this plot can be used in strategy. You can keep it transparent.

            Comment


              #21
              can you share a code of it?

              Comment


                #22
                Custom201010.zip
                Here you get it!

                Comment


                  #23
                  Thanks, now it works like a charm both as indicator and in strategy.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  600 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  347 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
                  558 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X