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 rexsole, Today, 08:39 AM
    0 responses
    4 views
    0 likes
    Last Post rexsole
    by rexsole
     
    Started by trilliantrader, Yesterday, 03:01 PM
    3 responses
    30 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    4 responses
    26 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Brevo, Today, 01:45 AM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by rjbtrade1, 11-30-2023, 04:38 PM
    2 responses
    74 views
    0 likes
    Last Post DavidHP
    by DavidHP
     
    Working...
    X