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 burtoninlondon, Today, 12:38 AM
    0 responses
    5 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    13 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    13 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Working...
    X