• 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

SystemPerformance when Strategy not attached to a Chart

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

    SystemPerformance when Strategy not attached to a Chart

    Hi,

    Following a customer issue I noticed that SystemPerformance is always empty if the Strategy is attached to Control Center instead of a Chart.

    Using the example #1 from the help ;
    http://ninjatrader.com/support/helpG...collection.htm
    and adding a line to Enter Long on each up bar ( see example attached )

    If the Strategy is Enabled on a Chart it prints correctly the results of each trade.
    If it is attached on Control Center without using a Chart, then there are no results

    If there is another way to calculate the trade results, just let me know

    Thanks
    Pablo
    Attached Files
    pmaglio
    NinjaTrader Ecosystem Vendor - The Indicator Store

    #2
    Hello pmaglio,

    Thank you for your post.

    Please use SystemPerformance.AllTrades.TradesCount and advise if the TradesCount is 0 as well.

    You can find information on TradesCount at the following link: http://ninjatrader.com/support/helpG...radescount.htm

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your help,
      I see that SystemPerformance.AllTrades.TradesCount has the correct number of trades
      while SystemPerformance.AllTrades.Count is zero ( only when not attached to a chart )

      The problem now is that
      Trade lastTrade = SystemPerformance.AllTrades[SystemPerformance.AllTrades.TradesCount - 1]; tries to access a null array

      May be Im doing something wrong ?
      Im stuck here :
      https://www.screencast.com/t/fkzTL6Ib3UT
      pmaglio
      NinjaTrader Ecosystem Vendor - The Indicator Store

      Comment


        #4
        Hello pmaglio,

        Thank you for your patience.

        I was incorrect, you do not replace Count with TradesCount. You would still use Count but would include the following in the Configure State of your strategy:
        Code:
        IncludeTradeHistoryInBacktest = true;
        For information on IncludeTradeHistoryInBacktest please visit the following link: http://ninjatrader.com/support/helpG...inbacktest.htm

        Please let me know if you have any questions.
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by asmmbillah, Today, 04:53 AM
        0 responses
        1 view
        0 likes
        Last Post asmmbillah  
        Started by davidnorton, Today, 04:29 AM
        0 responses
        2 views
        0 likes
        Last Post davidnorton  
        Started by maggie3, Today, 02:05 AM
        0 responses
        3 views
        0 likes
        Last Post maggie3
        by maggie3
         
        Started by qewcool, Today, 01:14 AM
        0 responses
        3 views
        0 likes
        Last Post qewcool
        by qewcool
         
        Started by fredrikn, 05-08-2019, 04:01 AM
        17 responses
        669 views
        1 like
        Last Post emtrader  
        Working...
        X