Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem using BarsSinceEntryExecution

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

    Problem using BarsSinceEntryExecution

    When I add this condition to my strategy, the Strategy Optimizer never takes a trade.

    Code:
    // Set 1
    if ((blah blah blah)
      && (blah blah blah)
      && (BarsSinceEntryExecution() > 10 || BarsSinceEntryExecution() == -1))
    {
    ....
    I have tried adding the signal name as well.

    (BarsSinceEntryExecution("LongEntry")>10 || BarsSinceEntryExecution("LongEntry")==-1)

    #2
    Hello Trader_Mark,

    Does your strategy include exits?

    I am unable to replicate the issue you are having, see attached.

    So I may test on my end, please upload the strategy in the format below,

    To export a NinjaScript from NinjaTrader 8 do the following:
    From the Control Center window select Tools -> Export -> NinjaScript...
    Click Add>Select the indicator>OK>Export.
    Then attach that file you saved; under My Docs>NT8>Bin>Custom>Select the downloaded .zip file.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you.

      Strategy attached.

      Comment out the BarsSince.... condition and you should get trades. With that line in, I do not.
      Last edited by Trader_Mark; 08-18-2017, 04:24 AM.

      Comment


        #4
        Hello Trader_Mark,

        Running the strategy I get the following error in the log,

        8/17/2017 1:39:33 PM Default Strategy 'Kaboom': Error on calling 'OnBarUpdate' method on bar 4349: Strategy 'Kaboom/114383134': You must use the overload that has a 'BarsInProgress' parameter when calling the BarsSinceEntryExecution() method in the context of a multi-time frame and instrument strategy.

        Please see the Note: in the following section of our helpguide in regards to multiseries strategies.


        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        195 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        359 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        281 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X