Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsSinceExit

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

    BarsSinceExit

    Can anyone please show me the proper syntax for using BarsSinceExit() to identify a an exit PRIOR to the last trade? In the instructions it simply says to "pass in 0 for the number of bars since the last exit". So I used this;

    BarsSinceExit(1)

    however, I get an error when compiling, "can not convert from int to string". So then I tried this;

    BarsSinceExit("1")

    this will compile, but when I run my strategy and have this in my print statement for debugging purposes, it always shows " -1 ", even after severa trades, as if no trades have been exited.

    Thanks,

    Safetrading

    #2
    safetrading,

    BarsSinceExit(string signalName)

    This string is a signal name, so it ties the number to a specific order :

    EnterLong(string signalName)

    If you are trying to use the BarsInProgress overload, this is the proper method :

    BarsSinceExit(int barsInProgressIndex, string signalName, int exitsAgo)

    Adam P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    85 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    48 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    67 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X