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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X