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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Yesterday, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Yesterday, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Yesterday, 03:01 PM
      2 responses
      22 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Yesterday, 07:24 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X