Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Question on OnEachTick and strange multiple entries/TPs

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

    Question on OnEachTick and strange multiple entries/TPs

    Hi all,

    I'm working on a strategy that uses volumetric bar data and OnEachTick calculation to handle entries. I'm noticing that, at least for historical and market replay testing, I get bars where I see a huge number of relatively simultaneous entries and take profits (or stop losses) and cannot figure out why since the price action is not matching this. Is this an anomaly with testing volumetric bar data? I haven't yet seen this when trading the strategy live, but I haven't had it running for that long, either. Any ideas?

    Click image for larger version

Name:	Screenshot 2022-09-21 080135.png
Views:	127
Size:	170.2 KB
ID:	1216475
    Ian

    #2
    Hi, thanks for posting. If the strategy does not have any code preventing it from taking more than 1 entry per bar it would keep entering every time your entry condition becomes true. You can check your current position and quantity through the Position object. You will need to add Print() methods throughout your code to see why the entry orders are being reached multiple times in a short time frame like what is shown in the screen shot. Here are some documented examples:


    Kind regards,
    -ChrisL



    Comment


      #3
      Many thanks for the quick reply NinjaTrader_ChrisL. I've encased my order entry logic with
      Code:
      if (Position.MarketPosition == MarketPosition.Flat && (BarsSinceEntryExecution() >= 1 || BarsSinceEntryExecution() == -1))
      and it seems to have resolved the issue!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 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
      119 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