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 rhyminkevin, Today, 04:58 PM
          3 responses
          46 views
          0 likes
          Last Post Anfedport  
          Started by iceman2018, Today, 05:07 PM
          0 responses
          5 views
          0 likes
          Last Post iceman2018  
          Started by lightsun47, Today, 03:51 PM
          0 responses
          7 views
          0 likes
          Last Post lightsun47  
          Started by 00nevest, Today, 02:27 PM
          1 response
          14 views
          0 likes
          Last Post 00nevest  
          Started by futtrader, 04-21-2024, 01:50 AM
          4 responses
          50 views
          0 likes
          Last Post futtrader  
          Working...
          X