• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.GetBars Method

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

    Bars.GetBars Method

    Hi,

    I'm trying to use the undocumented Bars.GetBars method to backfill historical ticks. I had it working in NT7.

    Currently my example code in 8 looks like this and the code runs, but does not really produce results.

    Code:
       BarsPeriod bpAsk = new BarsPeriod();
                    bpAsk.BarsPeriodType = BarsPeriodType.Tick;
                    bpAsk.MarketDataType = MarketDataType.Ask;
                    bpAsk.Value = 1;
                    bpAsk.BaseBarsPeriodValue = 1;
    
    
                    
    
                    Bars.GetBars(dBars.Instrument, bpAsk, this.beginTime, this.toTime, bars.TradingHours,
                       bars.IsDividendAdjusted, bars.IsSplitAdjusted, bars.IsTickReplay, bars.IsResetOnNewTradingDay,
                       LookupPolicies.Provider, MergePolicy.UseGlobalSettings, true, null, AdBars.IsRolloverAdjusted, null, GetBarsCallBack());
    And the Callback method...Any help appreciated on how to use this, currently I just make it return null so that it compiles and runs.

    Code:
      private Action<Bars, ErrorCode, string, object> GetBarsCallBack()
            {
                return null;
            }
    Thanks a lot.

    #2
    Hello Serialcoder,

    Thanks for your post and welcome to the Ninjatrader forums!

    Correct, in NinjaTrader 7 it is undocumented.

    In Ninjatrader 8 you would want to use BarsRequest which is documented. Please see: http://ninjatrader.com/support/helpG...arsrequest.htm

    (Note that while the link shows in the Helpguides's Add On area, the comment in the example advises: "...The concept can be carried over to any NinjaScript object you may be working on."
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the quick reply.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by brunoviveiros, Today, 04:26 AM
      0 responses
      1 view
      0 likes
      Last Post brunoviveiros  
      Started by Erhard, Today, 04:24 AM
      0 responses
      1 view
      0 likes
      Last Post Erhard
      by Erhard
       
      Started by StevenNelson, 11-19-2019, 05:39 AM
      3 responses
      16 views
      0 likes
      Last Post brucerobinson  
      Started by guidoisot, Today, 03:01 AM
      0 responses
      5 views
      0 likes
      Last Post guidoisot  
      Started by rontronimous, Yesterday, 05:55 PM
      0 responses
      10 views
      0 likes
      Last Post rontronimous  
      Working...
      X