Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Testing multiple strategies

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

    Testing multiple strategies

    HI guys,

    I'm testing a series of strategies in different timeframes on live data across the Hang Seng futures market.

    Is there a way of saving the bunch of strategies for each trading session and re-loading them again to run the next day?

    Also the Hang Seng has a 2 hour lunch break - is there a way to close out for lunch and re-start again?


    Does the "flatten everything" handle this function?

    Thanks
    Leonie

    #2
    Hi Leonie,

    Unfortunately there is no "save strategy" feature. Thank you for your suggestion. It is on the list of future considerations.

    You will need to program this close out and restart logic directly into your strategy. Please see this reference sample on time filters: http://www.ninjatrader-support.com/v...ead.php?t=3226
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      But the indicators would be totally ruined after the lunch break!!

      Comment


        #4
        For the lunch break problem you may consider adding a couple lines of code to your strategy to test the current time, then take appropriate action, ie:

        If the local PC time is NOT between 9:30am and 2:16pm, return.

        Code:
        if ((ToTime(Time[0]) <= 93000 || ToTime(Time[0]) >= 141600)) return;
        If the local PC time is between 11:55am and 12:10pm, return.

        Code:
        if ((ToTime(Time[0]) >= 115500 && ToTime(Time[0]) <= 121000)) return;
        You may also find this useful to not trade on weekends:
        Code:
        if (Time[0].DayOfWeek == DayOfWeek.Saturday || Time[0].DayOfWeek == DayOfWeek.Sunday) return;
        Mike

        Comment


          #5
          On time of day code where I'm checking for specific events (like open/lunch/close)... I found it easier to use code like:

          TimeSpan noon = new TimeSpan(12, 0, 0);

          ..
          if (Time[0].TimeOfDay < noon)
          // It's not noon yet.
          else
          // It's after noon.

          Simpler for my brain than dealing with seconds.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by geddyisodin, Today, 05:20 AM
          5 responses
          32 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by bmartz, Today, 09:30 AM
          2 responses
          12 views
          0 likes
          Last Post bltdavid  
          Started by f.saeidi, Today, 11:02 AM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by geotrades1, Today, 10:02 AM
          4 responses
          12 views
          0 likes
          Last Post geotrades1  
          Started by rajendrasubedi2023, Today, 09:50 AM
          3 responses
          16 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X