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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      431 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      282 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      243 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      331 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      292 views
      0 likes
      Last Post CarlTrading  
      Working...
      X