Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to export strategy descriptive details

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

    How to export strategy descriptive details

    NT Forum,

    I am looking to export descriptive details of a strategy.
    As per the attached picture, how would to print:
    • Strategy Name : TestStategy (e.g. Strategies[0].Description?)
    • DataSeries Name : ES 12-15 (60 Minute)
    • DataSeries End date : 16/11/2015

    Thanks
    Shannon
    Attached Files

    #2
    Hello,

    You can access this information in the Account.Strategies collection (the "Strategies" collection that you mentioned refers to ATM Strategies), although I'm not quite certain what you are looking for on the last item. Can you please clarify that a bit?

    The example below will obtain the first two pieces of info, and will also print out the end day of the first day in the configured Trading Hours template (you may have to tweak this last one a bit to find what you are really looking for, or I'll be happy to help find exactly what you're looking for once I fully understand).

    Code:
    Print(String.Format("{0}, {1}, {2}", Account.Strategies[0].Name, Account.Strategies[0].Instrument, Account.Strategies[0].TradingHours.Sessions[0].EndDay));
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Dave,

      Thanks for your reply.

      Regarding the DataSeries Name, is it possible to retrieve a value which includes the instrument and period type (i.e. ES 12-15 (60 Minute)). This value is shown in the attached Stategies and DataSeries windows.

      Regarding the DataSeries End Date, I was hoping to retrieve the value as shown in the attached DataSeries window.

      Thanks again
      Shannon
      Attached Files

      Comment


        #4
        For that, you can reference the Bars series attached to the strategy that you are looking into, like so:

        Code:
        Print(Account.Strategies[0].BarsArray[0].ToChartString());
        ToChartString() is an undocumented method which simply combines the instrument name and interval, which should do the trick for you.

        Regarding your question about the data series end date, I believe this should be what you are looking for:

        Code:
        Print(Account.Strategies[0].BarsArray[0].ToDate);
        ToDate will show the end date configured on the Data Series, and there is also a FromDate property which will show the configured start date.
        Dave I.NinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by alifarahani, 04-19-2024, 09:40 AM
        9 responses
        54 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by mmckinnm, Today, 01:34 PM
        2 responses
        5 views
        0 likes
        Last Post mmckinnm  
        Started by Conceptzx, 10-11-2022, 06:38 AM
        3 responses
        60 views
        0 likes
        Last Post NinjaTrader_SeanH  
        Started by f.saeidi, Today, 01:32 PM
        1 response
        2 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by traderqz, Today, 12:06 AM
        9 responses
        16 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X