Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Converting Code

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

    Converting Code

    I have 3 lines of code I am trying to convert and am having a little difficulty
    these are the lines

    MyBars1 = Bars.GetBars(Bars.Instrument, new Period(PeriodType.Minute, _minutes, MarketDataType.Last), Bars.From, Bars.To, (Session)

    Bars.Session.Clone(), Bars.SplitAdjust, Bars.DividendAdjust);

    IBar intradayBar = _intradayBars.Get(_intradayBars.GetBar(intradayBar Time));


    #2
    Hello ballboy11,

    Thank you for the post.

    In this situation I don't believe there are direct replacements as these were not a documented/technically supported items. The GetBar syntax still exists but the other items you have shown likely will need to be changed.

    I believe the closest match for GetBars would be the addon BarsRequest concept: https://ninjatrader.com/support/help...arsrequest.htm

    For a BarsRequest TradingHours.Get can be used to retrieve trading hours. In other scripts like an indicator the SessionIterator object can be used (see pivots).

    The Session.Clone would not be used in NT8, you could just retrieve the correct trading hours for the BarsRequest otherwise the SessionIterator is used.

    I am not able to see what type _intradayBars is in your syntax, can you provide more context for the _intradayBars syntax?





    look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    68 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    151 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X