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 geddyisodin, 04-25-2024, 05:20 AM
        8 responses
        58 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by halgo_boulder, 04-20-2024, 08:44 AM
        2 responses
        21 views
        0 likes
        Last Post halgo_boulder  
        Started by mishhh, 05-25-2010, 08:54 AM
        19 responses
        6,189 views
        0 likes
        Last Post rene69851  
        Started by gwenael, Today, 09:29 AM
        0 responses
        5 views
        0 likes
        Last Post gwenael
        by gwenael
         
        Started by Karado58, 11-26-2012, 02:57 PM
        8 responses
        14,830 views
        0 likes
        Last Post Option Whisperer  
        Working...
        X