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 iantriestrading, Today, 09:50 AM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by samish18, 10-27-2024, 05:48 PM
    8 responses
    143 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by g0sty, Today, 09:24 AM
    2 responses
    10 views
    0 likes
    Last Post g0sty
    by g0sty
     
    Started by Thomas79, 04-25-2025, 08:14 AM
    3 responses
    23 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by op1031, Yesterday, 10:22 AM
    4 responses
    22 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X