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

AllTrades.Count = 0 after closed managed trades

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

    #16
    Hi Zachary,

    Below is sample output when adding and activating this strategy from control panel (not from chart). Does not increment.

    Enabling NinjaScript strategy 'EnterExitTest/79821779' : On starting a real-time strategy - StartBehavior=WaitUntilFlat EntryHandling=All entries EntriesPerDirection=1 StopTargetHandling=Per entry execution ErrorHandling=Stop strategy, cancel orders, close positions ExitOnSessionClose=True / triggering 30 seconds before close SetOrderQuantityBy=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=False CancelExitsOnStrategyDisable=False Calculate=On each tick IsUnmanaged=False MaxRestarts=4 in 5 minutes
    7/13/2016 8:14:44 AM Strategy 'EnterExitTest/79821779': Entered internal SubmitOrderManaged() method at 7/13/2016 8:14:44 AM: BarsInProgress=0 Action=Buy OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    NinjaScript strategy 'EnterExitTest/79821779' submitting order
    SystemPerformance.AllTrades.Count: 0
    SystemPerformance.AllTrades.Count: 0
    SystemPerformance.AllTrades.Count: 0
    7/13/2016 8:14:44 AM Strategy 'EnterExitTest/79821779': Entered internal SubmitOrderManaged() method at 7/13/2016 8:14:44 AM: BarsInProgress=0 Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
    NinjaScript strategy 'EnterExitTest/79821779' submitting order
    SystemPerformance.AllTrades.Count: 0
    SystemPerformance.AllTrades.Count: 0
    SystemPerformance.AllTrades.Count: 0
    SystemPerformance.AllTrades.Count: 0
    SystemPerformance.AllTrades.Count: 0
    Again I tested this adding directly to a chart, and it works fine in that case. Count goes to 1.

    Comment


      #17
      Hello greagrea,

      Can you please provide a screenshot of all of the settings that you are using when adding the strategy to the Strategies tab of the Control Center?

      I would like to test with these exact settings to see if I am able to reproduce this behavior on my end.
      Zachary G.NinjaTrader Customer Service

      Comment


        #18
        Hi Zachary,

        Attached are the settings used.

        Thank you.
        Attached Files

        Comment


          #19
          Hello greagrea,

          After additional testing, it looks like I am able to reproduce this. The collection's count does not seem to be incrementing if added to the Strategies tab of the Control Center. Adding to a chart, though, and the count does increment.

          I will be reporting this to development. Thank you for catching this.
          Zachary G.NinjaTrader Customer Service

          Comment


            #20
            Hello greagrea,

            You'll want to add IncludeTradeHistoryInBacktest = true into the if (State == State.SetDefaults) condition within the OnStateChange() method: http://ninjatrader.com/support/helpG...inbacktest.htm

            After doing this, the collection will increment as expected when the strategy is added and ran from the Strategies tab.

            Please, let us know if we may be of further assistance.
            Zachary G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kaywai, Today, 06:26 AM
            1 response
            3 views
            0 likes
            Last Post kaywai
            by kaywai
             
            Started by ct, 05-07-2023, 12:31 PM
            6 responses
            202 views
            0 likes
            Last Post wisconsinpat  
            Started by kevinenergy, 02-17-2023, 12:42 PM
            118 responses
            2,779 views
            1 like
            Last Post kevinenergy  
            Started by briansaul, Today, 05:31 AM
            0 responses
            9 views
            0 likes
            Last Post briansaul  
            Started by traderqz, Yesterday, 12:06 AM
            11 responses
            28 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X