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 Shansen, 08-30-2019, 10:18 PM
          24 responses
          942 views
          0 likes
          Last Post spwizard  
          Started by Max238, Today, 01:28 AM
          0 responses
          9 views
          0 likes
          Last Post Max238
          by Max238
           
          Started by rocketman7, Today, 01:00 AM
          0 responses
          4 views
          0 likes
          Last Post rocketman7  
          Started by wzgy0920, 04-20-2024, 06:09 PM
          2 responses
          28 views
          0 likes
          Last Post wzgy0920  
          Started by wzgy0920, 02-22-2024, 01:11 AM
          5 responses
          33 views
          0 likes
          Last Post wzgy0920  
          Working...
          X