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 techgetgame, Yesterday, 11:42 PM
    0 responses
    8 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,613 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Yesterday, 05:56 PM
    0 responses
    10 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    20 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Working...
    X