• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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, 03: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 pstrusi, Today, 12:50 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by ralett, Today, 11:52 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by rtwave, Yesterday, 07:06 PM
        2 responses
        24 views
        0 likes
        Last Post rtwave
        by rtwave
         
        Started by DTSSTS, Today, 11:27 AM
        2 responses
        10 views
        0 likes
        Last Post DTSSTS
        by DTSSTS
         
        Started by siroya, Today, 10:02 AM
        2 responses
        9 views
        0 likes
        Last Post DTSSTS
        by DTSSTS
         
        Working...
        X