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:	121
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 NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X