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 f.saeidi, Yesterday, 02:09 PM
        3 responses
        18 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Jltarrau, Today, 05:57 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by kujista, Today, 06:23 AM
        0 responses
        1 view
        0 likes
        Last Post kujista
        by kujista
         
        Started by traderqz, Yesterday, 04:32 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by f.saeidi, Today, 05:56 AM
        1 response
        5 views
        0 likes
        Last Post Jltarrau  
        Working...
        X