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 reynoldsn, Today, 02:34 PM
          0 responses
          6 views
          0 likes
          Last Post reynoldsn  
          Started by nightstalker, Today, 02:05 PM
          0 responses
          9 views
          0 likes
          Last Post nightstalker  
          Started by llanqui, Yesterday, 09:59 AM
          8 responses
          28 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by quicksandatl, Today, 01:39 PM
          1 response
          6 views
          0 likes
          Last Post quicksandatl  
          Started by md4866, 05-01-2024, 08:15 PM
          2 responses
          18 views
          0 likes
          Last Post md4866
          by md4866
           
          Working...
          X