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

Secondary Data Series

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

    Secondary Data Series

    I am having some issues with having my strategy completely reference a secondary data series. It appears to be taking both data series into account as if they are one. I am using the code if (BarsInProgress !=1) return; in order to ignore the primary data series completely but this does not seem to be doing the trick.

    Any thoughts on to completely ignore the primary data series?

    Thanks.

    #2
    Originally posted by ejmatz View Post
    I am having some issues with having my strategy completely reference a secondary data series. It appears to be taking both data series into account as if they are one. I am using the code if (BarsInProgress !=1) return; in order to ignore the primary data series completely but this does not seem to be doing the trick.

    Any thoughts on to completely ignore the primary data series?

    Thanks.
    Needed to use BarsArray. Leaving this post in case anyone else needs the solution and has the same problem.

    Comment


      #3
      Originally posted by ejmatz View Post
      I am having some issues with having my strategy completely reference a secondary data series. It appears to be taking both data series into account as if they are one. I am using the code if (BarsInProgress !=1) return; in order to ignore the primary data series completely but this does not seem to be doing the trick.

      Any thoughts on to completely ignore the primary data series?

      Thanks.

      BIP!=1 means BIP=0,2,3,4,5.... so it is IGNORING your 2nd series, not the 1st.


      Comment


        #4
        Originally posted by sledge View Post
        BIP!=1 means BIP=0,2,3,4,5.... so it is IGNORING your 2nd series, not the 1st.


        https://ninjatrader.com/support/help...inprogress.htm
        But wouldn't the "return" line indicate that if it isn't =1 then return and if it is =1 then continue?
        Thanks for your help.

        Comment


          #5
          Hello,

          Thank you for the reply.

          Yes the syntax you have now should be ignoring the primary BIP 0 series.

          (!= 1) return; would allow for only BIP 1 to process beyond that point.

          From your provided syntax it is not really clear what may be happening in your logic, what I could suggest would be to use Prints to identify how the script is being run.

          For example:
          Code:
          Print("BIP: " + BarsInProgress + " CurrentBar: " + CurrentBar);
          If you place this at the top of OBU, you could see how all series process, if you place this after your return statement this could confirm only BIP 1 is being called.

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Salahinho99, 05-05-2024, 04:13 AM
          7 responses
          55 views
          0 likes
          Last Post Salahinho99  
          Started by knighty6508, 05-10-2024, 01:20 AM
          4 responses
          26 views
          0 likes
          Last Post knighty6508  
          Started by OllieFeraher, 05-09-2024, 11:14 AM
          6 responses
          19 views
          0 likes
          Last Post OllieFeraher  
          Started by PaulMohn, 05-02-2024, 06:59 PM
          2 responses
          44 views
          0 likes
          Last Post PaulMohn  
          Started by ETFVoyageur, Today, 02:10 AM
          0 responses
          19 views
          0 likes
          Last Post ETFVoyageur  
          Working...
          X