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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 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
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      72 views
      0 likes
      Last Post PaulMohn  
      Working...
      X