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 NullPointStrategies, Today, 05:17 AM
      0 responses
      46 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
      66 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