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

is AddDataSeries available in MarketAnalyzer

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

    is AddDataSeries available in MarketAnalyzer

    in state.configure i add:

    AddDataSeries (.... )

    however, CurrentBars[1] always show -1 in output when i debug the script.

    is that possible at all in MAnalyzer, to use MTF indicator?

    #2
    Hello TazoTodua,

    Thank you for the post.

    You can use multi-time frame indicators in a Market Analyzer column. I have attached a simple indicator that works. It will print its BarsInProgress context to the NinjaScript output window.

    Can you pull up a chart of the secondary series you are adding? Please also post some code snippets for review and report any errors in the log tab of your Control Center.

    I look forward to assisting further.
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      thanks.
      it works well on chart, but not on MAnzlr.

      please see this. it fires error in Output Log, when i add it to MA.


      BIP is ok, i care of CurrentBars
      it somehow show -1 for me , tried on AUD-USD, NQ 09-18.

      please use 5-min dataseries for MAnlzr for that script.
      Last edited by ttodua; 08-15-2018, 07:09 AM.

      Comment


        #4
        Hello TazoTodua,

        Thanks for the reply.

        I am unable to test the script because I do not have the ttLibrary.Methods dependency.

        I was able to reproduce the -1 CurrentBar that you are getting. It is happening because BarsInProgress == 1 has not loaded its data while you are accessing the CurrentBar from the primary series. Please see the modified script attached. As an example, this will occur when your primary series is a 1-minute series and the secondary series is a 5-minute series.

        Please let me know if I may assist further.
        Attached Files
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          thanks.
          1) sorry, that script doesnt need ttLibrary at all. here is that script again, without any dependancy:

          (now the script will compile well)

          from your post, i was unable to understand the solution.
          because i use the code inside BIP==0 block, however, still getting -1 for CurrentBars[1].

          for example, add that script on MAnlz, 5 min source series, and 10min as second.

          in output log you will see the CurrentBar = -1 (when it's checked for secondary series).

          what is solution to wait for load of bars in 2nd tf data in MAnlzer?

          on charts, it works well.

          many thanks for help.


          2) btw, i see "Data.BarsPeriodType.Minute" instead of "BarsPeriodType.Minute". why is the `Data` keyword there?

          Comment


            #6
            Hello TazoTodua,

            Thanks for the reply;

            We found that you are only checking the primary bar series for enough bars on line 108. You will need to check that you have enough bars in all series that the script is using. You will use the plural CurrentBars property to check for this.

            Code:
            if (CurrentBars[0]<=MACD_Slow_Length ||
            				CurrentBars[1]<=MACD_Slow_Length ||
            				CurrentBars[2]<=MACD_Slow_Length) return;
            https://ninjatrader.com/support/help...urrentbars.htm - CurrentBars

            Please let us know if we can assist further.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              probably i understand, thank you i will test that.
              MANY THANKS!
              Last edited by ttodua; 08-15-2018, 01:40 PM.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rocketman7, Today, 09:41 AM
              2 responses
              4 views
              0 likes
              Last Post rocketman7  
              Started by traderqz, Today, 09:44 AM
              1 response
              2 views
              0 likes
              Last Post traderqz  
              Started by rocketman7, Today, 02:12 AM
              7 responses
              31 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by guillembm, Yesterday, 11:25 AM
              3 responses
              16 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by junkone, 04-21-2024, 07:17 AM
              10 responses
              149 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X