Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

is there any way to record volumes (ask size and bid size)

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

    #31
    Originally posted by fxeconomist View Post
    Which means, that if I apply it to a list, this list will be before everything I add. So, reiterating my question, could I find out, in the Initialize(), at least how many instruments are already there? for instance

    Code:
     protected override void Initialize()
            {
             int already=.....
             Add("6E 09-11",PeriodType.Tick,1); //i know 6E will have BarsInProgress=already;
             Add("6J 09-11",PeriodType.Tick,1); //i know 6J will have BarsInProgress=already+1
            //and so on
           }
    is there anything to tell me the value of that "already" ? Or, even more, is there a way to enumerate these already present symbols? For instance , i wanna know what symbol is on 0, what is on 1, and so on. Is this possible?
    If you apply your strategy to a list, then each instrument on the list will be the primary series on its own chart, so "item 0" will always be the instrument to which the strategy is applied; in this case, "item 0" will each be an instrument in the list to which the strategy is applied.

    Whether you apply the strategy to single instruments one at a time, or to single instruments contained in a list, the behavior is consistently the same: the primary series is the instrument to which the strategy is applied.

    Comment


      #32
      Originally posted by NinjaTrader_Josh View Post
      fxeconomist,

      You will only know when you are done processing Initialize().

      What is your concern for this info though? If you really want it to just be all known what you can do is completely ignore BarsInProgress 0, add all the series you want and then you will know what 1, 2, 3, 4 will be based on the order you added them in Initialize().

      Also, you will always know what 0 is before you even begin the script because that is the series you will be adding your script onto. If you need it to be 6E or 6J, just make sure you correctly add it to the 6E or 6J chart.
      So, translating this, if I attach the strategy to a list, that won't make it a multi-instrument strategy; Ninja will attach to each instance of the strategy one of the assets of the list, running it in a portfolio manner. Opening more than one data series in a strategy is strictly something that is about "programming" rather than "setting up the parameters". Guess I got it.

      Comment


        #33
        Originally posted by NinjaTrader_Josh View Post
        fxeconomist,

        You will only know when you are done processing Initialize().

        What is your concern for this info though? If you really want it to just be all known what you can do is completely ignore BarsInProgress 0, add all the series you want and then you will know what 1, 2, 3, 4 will be based on the order you added them in Initialize().

        Also, you will always know what 0 is before you even begin the script because that is the series you will be adding your script onto. If you need it to be 6E or 6J, just make sure you correctly add it to the 6E or 6J chart.
        What if I would programatically add one of the symbols that would be the same as the on BarsInProgress 0 ? Would that be possible or generate an error? But I code around to avoid this. The real issue about running it on asset that I don't need as BarsInProgress 0 is that I would create unwanted latency by processing something that I don't need, but gets as far as the OnMarketUpdate(), stealing from the arrival time of the ticks that I need.

        Comment


          #34
          fxeconomist, there will be no issue with adding a series exactly the same as the primary one. As for the latency issue, I was curious about this myself, so I just created a simple test to see how much latency there is between the different BarsInProgress calls. From what I can tell, there is no difference, at least not with my PC's time resolution (0.0005 seconds). The latency between your computer and your broker through the internet will be at least a hundred times greater than what this test shows.
          Attached Files
          AustinNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          590 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          342 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
          555 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X