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 nandhumca, Today, 08:47 PM
      0 responses
      5 views
      0 likes
      Last Post nandhumca  
      Started by BullyWig Trader, Today, 07:15 PM
      0 responses
      5 views
      0 likes
      Last Post BullyWig Trader  
      Started by ezrollin, Today, 05:13 PM
      1 response
      13 views
      0 likes
      Last Post ezrollin  
      Started by ineuron, Today, 04:29 PM
      0 responses
      8 views
      0 likes
      Last Post ineuron
      by ineuron
       
      Started by topa11, Today, 04:21 PM
      0 responses
      17 views
      0 likes
      Last Post topa11
      by topa11
       
      Working...
      X