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

Access Price Data for Instrument not Added as Series

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

    Access Price Data for Instrument not Added as Series

    Hi

    How do I access price data for an instrument that has not been added as a data series?

    The reason I ask is that to calculate the correct position size I need to access the counter currency and dont want to add the counter currency as a data series.

    Thanks

    Mike

    #2
    Hi Mike, this is unfortunately not possible - to access another instruments data programmatically you would have to Add() it first.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand.

      How do you add a new Dataseries out side the Initialize(). If I try and call Add outside the Initialize() I get an exception.

      Thanks

      Mike

      Comment


        #4
        Unfortunately an expected exception - you would need to Add() in the script's Initialize() method.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          So is it not possible to Add a data series using a different method at a later stage?

          Comment


            #6
            Unfortunately not in a supported way...as a hint you can look into the asynchronous loading the Pivots indicator would use...
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks for your help, that was just what I was after.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by usglucofreeze, Today, 01:19 AM
              0 responses
              6 views
              0 likes
              Last Post usglucofreeze  
              Started by f.saeidi, Today, 01:12 AM
              0 responses
              2 views
              0 likes
              Last Post f.saeidi  
              Started by NinjaTrader_ChelseaB, 03-14-2017, 10:17 AM
              227 responses
              34,318 views
              7 likes
              Last Post rare312
              by rare312
               
              Started by f.saeidi, Today, 12:11 AM
              0 responses
              5 views
              0 likes
              Last Post f.saeidi  
              Started by Graci117, Yesterday, 11:40 PM
              0 responses
              6 views
              0 likes
              Last Post Graci117  
              Working...
              X