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, Yesterday, 06:48 PM
    1 response
    12 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    15 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Working...
    X