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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      59 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      134 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      75 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      50 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X