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

CalculateOnBarClose

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

    CalculateOnBarClose

    CalculateOnBarClose = false.
    Chart = 5 minute.
    NT7

    What does Close[1] and Close[0] refer to??

    Does Close[0] return the Close of the current tick or the Close of the current 5 minute bar??

    Does Close[1] return the Close of the prior 5 minute bar or the Close of the prior tick of the current 5 minute bar??

    Thanks

    #2
    Romulan,

    I am happy to assist you.

    Close[0] will be the most current quoted price, so ticks.

    Close[1] will be the closing price of the last 5 minute bar.

    This is only true if CalculateOnBarClose = false;

    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Adam,

      I always think of quotes are Ask and Bid prices, but they can also be the most recent trade price. Isn't Close[0] actually the most recent traded price in the current bar or interval?

      That's why Close[0] is confusing, because for any historical bar or interval, there is only one Open, High, Low, Close, but while the current bar is forming, the latest trade price is the same as the Close[0] even though the Closing price has yet to be established.

      Comment


        #4
        borland,

        Close[0] with CalculateOnBarClose = false will be the "last" price. If you want bid/ask data you can use GetCurrentBid() and GetCurrentAsk().

        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        6 views
        0 likes
        Last Post Rapine Heihei  
        Started by f.saeidi, Today, 08:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 07:51 PM
        0 responses
        8 views
        0 likes
        Last Post Rapine Heihei  
        Started by frslvr, 04-11-2024, 07:26 AM
        5 responses
        98 views
        1 like
        Last Post caryc123  
        Working...
        X