Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with BarsSinceEntryExecution -1

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

    Help with BarsSinceEntryExecution -1

    Can someone show me why BarsSinceEntryExecution is always -1? Its not recogninzing the entry. Code lines 160 & 183 are like
    if(Position.MarketPosition == MarketPosition.Long && BarsSinceEntryExecution(0, "matthewrenko1long", 0) >= 1 )
    because there is another dataseries[1] exists. You would need to use a UniRenko chart. When you execute only 1 entry will fire early in chart. Then it will never close trade since BarsSinceEntryExecution = -1. I read related posts on this forum to get this far. thanks
    Attached Files

    #2
    Hello Kicks.Spin,

    Thanks for your post.

    This line: if(Position.MarketPosition == MarketPosition.Long && BarsSinceEntryExecution(0, "matthewrenko1long", 0) >= 1 ) is looking for an entry named matthewrenko1long.

    This line EnterLong(); does not use that signal name.

    The same is true for the short order as well.

    I would suggest adding the signal name to the entry order.

    Reference: https://ninjatrader.com/support/help...yexecution.htm


    Comment


      #3
      thank you. got it!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X