Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on calling 'OnBarUpdate' method for Strategy (Multi time frame and instrument)

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

    Error on calling 'OnBarUpdate' method for Strategy (Multi time frame and instrument)

    MORE INFO: Also, just so you know in case it matters I have 3 BarArrays (the primary, Day, and Week)...So, 3 indexes (0, 1, and 2 for the bar objects).

    Hi there:

    Error on calling 'OnBarUpdate' method for Strategy (Multi time frame and instrument)

    Please see the attached screenshot. I highlight in light yellow what the explanation of the error is...The issue is with the dark yellow with the Category name "Strategy"

    I recently added and a multi time frame function (not instrument at the time...just multi time frame). It compiles ok etc. How do I fix this? Here is the beginning of the 'OnBarUpdate':

    Code:
    protected override void OnBarUpdate()
            {
                // OFF if backtesting. But ON if trading Calc on False if (Historical) return;
                if (Position.MarketPosition == MarketPosition.Flat) // Be Flat
                    if(FirstTickOfBar)
                    {
                        x = 0;
                    }
                    if (BarsInProgress != 0)
                    return;
                    
                    if (CrossAbove(SMA(Fast), SMA(Slow), 1)..."ETC ETC ETC"
    Is it the construction of the expression for the BarsInProgress or something?
    Attached Files
    Last edited by birdog; 01-29-2013, 06:10 PM. Reason: more info...

    #2
    "may" have found the issue...I just added:

    if (Historical) return; to the beginning and I can enable now...but...

    What is the difference or nuance in doing that vs what the error message says about using overload and BarSinceEntry is mentions with BarsInProgress per the screenshot on the last post and here: http://www.ninjatrader.com/support/h...nstruments.htm

    Just want to know...and want to know if it is better one way or another etc...smile...

    Greg

    Comment


      #3
      Hi Greg, the message informed you that for MultiSeries use, this overload would need to be used for BarsSinceEntry -

      BarsSinceEntry(int barsInProgressIndex, string signalName, int entriesAgo)

      Comment


        #4
        Where do I put the code...getting compiling issues...could you show the actual code and where to put it?

        Comment


          #5
          How to serialize a string to display like an asterisk. For example, my string is a password and I want it to be displayed in the setup page as an asterisk.

          Comment


            #6
            Edward, can you please open a new thread for this unrelated inquiry - thank you.

            Comment


              #7
              Originally posted by birdog View Post
              Where do I put the code...getting compiling issues...could you show the actual code and where to put it?
              Sorry, I'm not following you - you would put in the same place where your other BarsSinceEntry call was, however since you operate in a MultiSeries strategy you would need to specify the BarsInProgress to use via the advanced overload provided.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              649 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              576 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X