Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsSinceEntry()

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

    BarsSinceEntry()

    Hi,

    I have a strategy that works, but when I enter this code the strategy stops working (it compiles fine but when executed it does not place any orders).

    This is literally the only addition to the code:

    Print(BarsSinceEntry());

    The tooltip says "*do not use this overload on a multitime and instrument strategy"

    If I use :

    Print(BarsSinceEntry("sellSignalShort"));

    it sill doesnt work.

    Any ideas?

    #2
    I tried adding:

    if(BarsInProgress != 0)
    return;

    but it didnt make any difference.

    p.s. it is a multitimeframe but not a multiinstrument strategy.

    Comment


      #3
      Hi spinalwiz,

      Do you get any errors in the Log tab when applying the strategy?

      You want to use the full syntax when working with more than one bars object (multitime) :

      BarsSinceEntry(int barsInProgressIndex, string signalName, int entriesAgo)

      Comment


        #4
        Thanks, this works

        Comment


          #5
          Great, good to hear, happy developing!
          Last edited by NinjaTrader_Bertrand; 12-04-2008, 08:04 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          646 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          367 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          570 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X