1

Dynamic parameter injection


Avatar
Ran

The idea here is to be able to use external variables in strategies without restarting them.

Example use cases:

  1. Change broker without changing the code
  2. Do parameter optimization in a backtester
  3. Set max DD/thresholds based on market conditions
  4. etc

We can achieve this by allowing users to create a "parameter" object that will be pushed along with any Tradehook, for example:

{
  "broker_id": "current_broker",
  "stoploss": 0.02
}

Currently, every Tradehook payload has event, and data parameters. We can push the new param object as the third parameter, so and pass it to the strategy function as additional param, for example:

def strategy(tradehook, payload, params):
    // send order using account_id = params.get('account_id')
    pass

We'll also introduc a way to auto-generate params to run optimization, for example

long_ma:

  1. Steps = 6
  2. Min = 20
  3. Max = 80

short_ma:

  1. Steps = 10
  2. Min = 100
  3. Max = 200

and we'll run the with each combination to find the best combination and present statstics for each

A

Activity Newest / Oldest

Avatar

Ran

Status changed to: Planned