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

SampleEnterOnceExitEveryTick

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

    SampleEnterOnceExitEveryTick

    Hi,

    I am reviewing the above sample strategy since I am interested in developing a new strategy based on the same concept. I was a bit confused about how the strategy engine works as bars are constructed, but I think I have it worked out. Please advise if I have this straight in my mind:

    From what I have read and seen in the sample, it seems that during OnBarUpdate(), when Calculate == OnBarClose and IsFirstTickOfBar == true, a reference to any Bar data series such as Close[] with an index of 0 would refer to data of the bar that just closed. But if Calculate == OnPriceChange or OnEachTick, then the the index of 0 would point to the current bar that has just received its first tick and is in the process of being built. Is this correct?

    If so, this means that if Calculate == OnBarClose, then IsFirstTickOfBar is always true and actually means IsLastTickOfBar (and, in effect also means "OnlyTickOfBar"). Correct?

    And all this would be true only for real-time operation with a live market data feed, or with Historical data if using Market Replay or Tick Replay. Otherwise only OnBarClose is valid. Correct?

    Thanks,

    CJ


    #2
    Hello ChazJ,

    Thanks for your post.

    Your understanding is correct.


    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Brevo, Today, 01:45 AM
    0 responses
    6 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
    242 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