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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X