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.
        http://ninjatrader.com/support/helpG...yexecution.htm

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Renejm, Today, 06:17 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by kazisl, Yesterday, 06:41 PM
        2 responses
        10 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by impactX, 05-04-2021, 01:07 AM
        2 responses
        11 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Started by op1031, Yesterday, 05:51 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by aaadetos, 05-04-2021, 09:28 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_Heath  
        Working...
        X