Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IsFirstTickOfBar is always true using Forex.com Demo DataFeed?

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

    IsFirstTickOfBar is always true using Forex.com Demo DataFeed?

    Hello,

    I'm forward testing a strategy (OnBarClose) using Forex.com Demo DataFeed, and I notice that IsFirstTickOfBar is always true while the candle is forming.

    My entry logic is using this IsFirstTickOfBar ​as one of the conditions to make sure allowing the trade only at the bar start.
    1. Is this issue because of the absence of free demo tick data?
    2. What is the best alternative to IsFirstTickOfBar ​to be used in this case with Forex.com DataFeed.
    Thank you.

    #2
    Hello PrQuantumH,

    If Calculate is OnBarClose, then OnBarUpdate will only update on the first tick of a new bar. Meaning IsFirstTickOfBar will always be true, because we are only updating after a bar has closed (which is when a new bar opens).

    If you want to see IsFirstTickOfBar be false, you would need to use Calculate.OnPriceChange or .OnEachTick which update even when its not the first tick of a new bar, directly after a bar has closed.

    If this is historical, you also need TickReplay.


    This applies to all data feeds. In historical, this means the data feed must supply historical tick data to enable TickReplay.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you Chelsea B.

      You are correct, I found out that the reason of having entries within the candle formation is because of presence of the tick data series and there was no check for the BarsInProgress for the trading Series inside the OnBarUpdate. Therefore, it was checking the entry logic with every new tick.

      And yes, there will be no need to use IsFirstTickOfBar while using the OnBarClose.

      Thanks a lot.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      86 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      151 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      79 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      53 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      61 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X