Announcement

Collapse
No announcement yet.

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.


    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    47 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X