Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Batch the backtest with variation in parameters, result in CSV (new pull request from develop branch) #1109

Closed
wants to merge 1 commit into from

Conversation

pprados
Copy link

@pprados pprados commented Sep 11, 2017

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    This extension launch many times a back test, with different parameters.
    All the results are added in a CSV file. It's easy to try different parameters values for the same data, or
    to check a strategy in a sliding windows.
    See config.lab in sample-config.js
    To start, check the backtest
    node gekko --config <...> --backtest
    then use
    node labgekko --config <...> --backtest
config.lab={
  enabled:true,
  file:"labs/"+config.tradingAdvisor.method+".csv",
  // Fields to add in CSV. Can be omitted or reorders
  fields:[
    "method", "exchange","currency","asset",
    "candleSize","historySize",
    "patchs",
    "startTime","endTime","timespan",
    "startPrice","endPrice","market","trades",
    "startBalance","balance","profit",
    "relativeProfit", "relativeResult"
  ],
  // Lists of modification to apply in config.
  patchs:[
    { 
      path: "MACD.short",
      loop: ["5", "<= 15", "+ 5"], // Normal:10
    },
    { 
      path: "MACD.long",
      loop: ["16", "<= 26", "+ 5"], // Normal:21
    },
    { 
      path: "MACD.signal",
      loop: ["8", "<= 10", "+ 1"], // Normal:9
    },
    {
      path:"backtest.daterange",
      exloop:[
        'config.{}={from:"2016-01-01", to: "2016-04-01"}',
        'moment(config.{}.to).isBefore("2017-12-15")',
        'slidingWindow(config.{},1, "month")',
        '// require nothing in global scope',
      ],
    },
  ],
}
  • What is the current behavior? (You can also link to an open issue here)

  • What is the new behavior (if this is a feature change)?

  • Other information:

@pangoyal
Copy link

@askmike do you have plans to merge this PR anytime soon?

@stale
Copy link

stale bot commented Oct 24, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you feel this is very a important issue please reach out the maintainer of this project directly via e-mail: gekko at mvr dot me.

@stale stale bot added the wontfix label Oct 24, 2018
@stale stale bot closed this Oct 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants