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 rbeckmann05, Today, 06:48 PM
    0 responses
    4 views
    0 likes
    Last Post rbeckmann05  
    Started by rhyminkevin, Today, 04:58 PM
    4 responses
    52 views
    0 likes
    Last Post dp8282
    by dp8282
     
    Started by iceman2018, Today, 05:07 PM
    0 responses
    5 views
    0 likes
    Last Post iceman2018  
    Started by lightsun47, Today, 03:51 PM
    0 responses
    8 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    14 views
    0 likes
    Last Post 00nevest  
    Working...
    X