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:	124
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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      79 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X