Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsSinceEntry() - Question

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

    BarsSinceEntry() - Question

    How does this function work when no entries have occured prior to the time the function was triggered? When I used this in code that was filtering conditions for an entry signal, I found that no entry signals were ever triggered.

    If the function needs a preceding entry signal to work properly, how can it be used for the initial entry signal?

    #2
    Either a value of zero or a negative value. To test, just print out the value.

    Print(BarsSinceEntry());
    RayNinjaTrader Customer Service

    Comment


      #3
      BarsSinceEntry() - Still Confused

      Thanks for the prompt response, but I still don't understand.

      The code I used was something like this:

      if (BarsSinceEntry() > 10)
      {
      EnterLong();
      }

      My problem is that nothing happened when the condition was true.

      Your initial answer was use either 0 or -1 and test to see what happens. Can you express your answer by telling me what's wrong with my code example above?

      Thanks.

      Comment


        #4
        EnterLong() never will be triggered since its value never will be greater than 10. Please proceed as per Ray's post below to understand what value BarsSinceEntry returns in case no trade was entered yet.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        630 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        566 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X