Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 f.saeidi, Today, 08:01 PM
        0 responses
        4 views
        0 likes
        Last Post f.saeidi  
        Started by Rapine Heihei, Today, 07:51 PM
        0 responses
        3 views
        0 likes
        Last Post Rapine Heihei  
        Started by frslvr, 04-11-2024, 07:26 AM
        5 responses
        96 views
        1 like
        Last Post caryc123  
        Started by algospoke, 04-17-2024, 06:40 PM
        6 responses
        49 views
        0 likes
        Last Post algospoke  
        Started by arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Working...
        X