Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Referencing date in custom optimizer?

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

    Referencing date in custom optimizer?

    Hi,

    1. I'm coding a custom optimizer.cs but have hit a snag. I want to assign weights to profits and losses according to when those profits/losses occured, the most recent peformance having the most weight, much in the way an EMA is calculated for a price series.

    I therefore need to reference trades to dates (I only need to calculate results per day for now) to identify trade exits on the last day of the optimization window and -1 days back repeatedly from there to the opening day of the window.

    It looks like the OptimizationType class only deals with trades in totallity - can they be split by day and if so how best to approach the coding?

    2. I've a second issue related to WFO which I can not find a solution for on the forums although I've seen the issued raised - How to have a test period of exactly one day? I have already created a custom session template which starts at 00:01 and finishes at 23:59 and have used that to successfully optimised for only those dates within the optimization window. But no trades are ever recorded using the same session template with test period set to 1 day, although trades do appear on these dates when the test window is set to 2 or more days.

    Grateful of course for any feedback.

    Many thanks in advance

    #2
    An update on the second query.

    Using the custom session manager template I was catching all trades up to the end of the optimization but NOT those for the first day (thought I was but in fact was not). This is why setting the test period to one day returned no trades. This issue was the strategy is multi-time frame and was calling a 60 minute bar. As the session started one minute into the day the strategy needed to look back a further day to get that 60 minute bar (I have BarsRequired set to 0) to run as intended.

    To test it out I removed the 60 minute data series and was able to see trades on the first day of the optimisation AND see results for the 1 day test period.

    As my strategy is coded only to trigger between 08:00-22:00 I can leave the 60 minute bars in (a key part of the strategy) and just edit the session manager template to start 61 minutes into the day. I'll do that and report back.

    Still no luck regarding the first query regarding calling days/dates from within OptimisationType class.

    Comment


      #3
      Thanks for the update mokodo, you'e correct about your MultiSeries calling observation.

      Unfortunately we cannot really support the creation of custom optimization types - I'll leave this open for community members to share their observation here.
      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by SantoshXX, Today, 03:09 AM
      0 responses
      13 views
      0 likes
      Last Post SantoshXX  
      Started by DanielTynera, Today, 01:14 AM
      0 responses
      2 views
      0 likes
      Last Post DanielTynera  
      Started by yertle, 04-18-2024, 08:38 AM
      9 responses
      42 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by techgetgame, Yesterday, 11:42 PM
      0 responses
      14 views
      0 likes
      Last Post techgetgame  
      Started by sephichapdson, Yesterday, 11:36 PM
      0 responses
      2 views
      0 likes
      Last Post sephichapdson  
      Working...
      X