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 futtrader, 04-21-2024, 01:50 AM
        4 responses
        41 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        11 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        3 views
        0 likes
        Last Post port119
        by port119
         
        Started by Philippe56140, Today, 02:35 PM
        0 responses
        4 views
        0 likes
        Last Post Philippe56140  
        Started by 00nevest, Today, 02:27 PM
        0 responses
        2 views
        0 likes
        Last Post 00nevest  
        Working...
        X