Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

UpdateBar NT7 convert to UpdateBar NT8

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

    UpdateBar NT7 convert to UpdateBar NT8

    NT7 UpdateBar has open, high, low, close but NT8 UpdateBar has only high, low , close how to convert?

    ---NT7 code
    ......
    Data.Bar bar = (Bar)bars.Get(bars.Count - 1);

    UpdateBar(bars, bar.Open, (close > bar.High ? close : bar.High), (close < bar.Low ? close : bar.Low), close, time, volume, isRealtime);
    ......

    --NT8 code

    .................
    UpdateBar(bars,
    // bars.GetOpen(bars.Count - 1), //no Open in NT8 ??????????
    (close > bars.GetHigh(bars.Count - 1) ? close : bars.GetHigh(bars.Count - 1)), (close < bars.GetLow(bars.Count - 1) ? close : bars.GetLow(bars.Count - 1)), close,time, volume);
    .....

    How to convert? since Open is missing in NT8?
    Attached Files
    Last edited by nkhoi; 12-29-2017, 01:05 AM.

    #2
    Hello,

    Thank you for the post.

    I will need to get further clarification on this to understand why this may have been removed. It does appear that all of the standard bar types have been modified to omit the open where UpdateBar is used. If you are creating a type that is similar to one of the existing bar type, you could use the included bars types as a reference point while developing. Once I have further information on this item, I will reply back here.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello,

      After further clarification, In this case, to adjust open you need to RemoveLastBar then AddBar to modify the open price and set IsRemoveLastBarSupported bar bool to true.

      I look forward to being of further assistance.
      JesseNinjaTrader Customer Service

      Comment


        #4
        Originally posted by nkhoi View Post
        NT7 UpdateBar has open, high, low, close but NT8 UpdateBar has only high, low , close how to convert?

        ---NT7 code
        ......
        Data.Bar bar = (Bar)bars.Get(bars.Count - 1);

        UpdateBar(bars, bar.Open, (close > bar.High ? close : bar.High), (close < bar.Low ? close : bar.Low), close, time, volume, isRealtime);
        ......

        --NT8 code

        .................
        UpdateBar(bars,
        // bars.GetOpen(bars.Count - 1), //no Open in NT8 ??????????
        (close > bars.GetHigh(bars.Count - 1) ? close : bars.GetHigh(bars.Count - 1)), (close < bars.GetLow(bars.Count - 1) ? close : bars.GetLow(bars.Count - 1)), close,time, volume);
        .....

        How to convert? since Open is missing in NT8?
        Even though the bar open field is visible in NT7, it is not adjustable and cannot be updated.
        The NT8 version does not have this field which is more correct because it is not update-able. The only way to change it is by the method described in prior post.
        RJay
        NinjaTrader Ecosystem Vendor - Innovative Trading Solutions

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by helpwanted, Today, 03:06 AM
        1 response
        7 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        7 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        385 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X