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 cls71, Today, 04:45 AM
      0 responses
      1 view
      0 likes
      Last Post cls71
      by cls71
       
      Started by mjairg, 07-20-2023, 11:57 PM
      3 responses
      213 views
      1 like
      Last Post PaulMohn  
      Started by TheWhiteDragon, 01-21-2019, 12:44 PM
      4 responses
      544 views
      0 likes
      Last Post PaulMohn  
      Started by GLFX005, Today, 03:23 AM
      0 responses
      3 views
      0 likes
      Last Post GLFX005
      by GLFX005
       
      Started by XXtrader, Yesterday, 11:30 PM
      2 responses
      12 views
      0 likes
      Last Post XXtrader  
      Working...
      X