Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

simulation index variabile inside a strategy when running optimization

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

    simulation index variabile inside a strategy when running optimization

    Hi, strategy and optimization tech question.
    I'm adding a perturbation analysis to my strategy development that save a different equity curve each simulation run.
    I would have a dynamic variable inside the strategy identifying the backtest index.

    To make an example:
    Strategy name: "MySTrategy"
    Optimization parameter: take profit, from 60 to 100, step 10

    When launching the strategy analyzer, five backtests will be executed.
    I'm looking for a variable available IterationIndex inside the strategy, say from 1 to 5, so to be able to save results like:
    SaveFileName = "MyStrategy" + IterationIndex.ToString()

    At the moment I'm using a combination of all optimization parameters converted into a string. That's a working solution but not a general one neither elegant.
    SaveFileName = "MyStrategy" + TakeProfit.ToString() + StopLoss.ToString() + ....... + ".csv"

    I also tried to generate a brute random variable but it seems that this approach cannot work being the seed linked to at internal clock at ms value, too slow indeed.

    Btw, here the typical result of this kind of analysis when plotted with my python script.

    Thanks
    Attached Files
    Last edited by simone.bern; 05-26-2022, 01:18 AM.

    #2
    Hello simone.bern,

    Thank you for your post.

    We would suggest trying System.Guid.NewGuid().ToString() or this.GetHashCode() in State.DataLoaded to get a unique identifier.

    However, you may find that what you're doing to track all settings in a string may be more informative.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Thank you Kate, that perfectly.suits my needs.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      72 views
      0 likes
      Last Post PaulMohn  
      Working...
      X