Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

strategy analyzer template with timespan() vars

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

    strategy analyzer template with timespan() vars

    NT8 RC1

    Hi,

    Saving a strategy analyzer template with string, int, double and timespan vars, works as expected. All data is saved with the exception of the timespan vars. Below is a part of my \NinjaTrader 8\templates\Strategy xml template file (time01, time02, time03 are timespan vars):

    <tradetype>Long_Short</tradetype>
    <swing_strength>5</swing_strength>
    <rrr>2</rrr>
    <swing_spread_min>5</swing_spread_min>
    <adx_line>20</adx_line>
    <trades_day>0</trades_day>
    <loss_trades_day>0</loss_trades_day>
    <time01 />
    <time02 />
    <time03 />

    <log_file>false</log_file>

    Any idea what could cause this problem?

    #2
    Hello enable,

    Thank you for your post.

    I am unable to recreate the same behavior on my end. Can you attach the script to your response?
    You can find the script under Documents\NinjaTrader 8\bin\Custom\Strategies.

    Comment


      #3
      Hi Patrick,

      Thanks for your feedback.

      aaa_swing02.cs is the stripped down strategy and aa_xml.txt the saved xml template file.

      To reproduce the symptom, change any data in the settings (C, D or E), than save it as strategy analyzer template. Open a new strategy analyzer window, click template and load the saved strategy template. Data will get repopulated, only the 3 timespan vars will show 00:00:00 rather than the before saved time.
      Attached Files

      Comment


        #4
        Hello enable,

        Thank you for your response and for sending over the files.

        I can reproduce this on my end. I will report this to development.

        Comment


          #5
          Hello enable,

          Thank you for your patience.

          NinjaTrader Serialization to the .xml template is not supported for TimeSpan. You would need to create a serialization on your own.

          You could use the following as an example:
          Code:
          [NinjaScriptProperty]
          [XmlIgnore]
          [Display(Name="MyTimeSpan", GroupName="Settings", Order=0)]
          public TimeSpan MyTimeSpan { get; set; }
          
          [Browsable(false)]
          public string MyTimeSpanSerializer
          {
              get { return MyTimeSpan.ToString(); }
              set { MyTimeSpan = TimeSpan.Parse(value); }
          }

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cre8able, Today, 01:16 PM
          2 responses
          9 views
          0 likes
          Last Post cre8able  
          Started by chbruno, 04-24-2024, 04:10 PM
          3 responses
          48 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by samish18, Today, 01:01 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by WHICKED, Today, 12:56 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by WHICKED, Today, 12:45 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X