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

last bar in training

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

    last bar in training

    hi guys how is possible have a body value ?, i tryed with (High[0]-Low[0]) , but return me a penultimate candel
    thankz

    #2
    Hello faustf,

    Thanks for your post.

    The definition of "penultimate" is "last but one in a series of things; second last.", so is your question why does the index[0] point to the prior closed bar and not the currently forming one or is your question as stated "how is possible have a body value"?

    If penultimate is the issue and you really want the current forming candle, then you would change the CalculateOnBarClose from true to false as this will then make the index of [0] point to the currently forming bar and [1] would now be the penultimate bar. Please note that in this mode, the Open value will not change but the Close value will continually change until the bar is completely closed. The penultimate bars values will not change.

    To get the body value of the candle, the body is defined as the distance between the Close and Open points of the candle, so Close[0] -Open[0] (or Open[0] - Close[0]) Reference: https://en.wikipedia.org/wiki/Candlestick_chart
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Brevo, Today, 01:45 AM
    0 responses
    3 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    238 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    6 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Working...
    X