Is that possible to build a python function, which could do backtesting automatically ?
Given the start date, end date, strategy and amount of money, the function can return the profit result.
The reason why I ask this question is that, to use backtesting result to optimize the parameters.
It should be possible with the Tradewave Platform API:
This is something I've been wanting to do for a while now, but just haven't had the time. If you come up with a clever solution for automatic backtesting and parameter optimization, you should share it here because I'm sure many people here would love to help collaborate on it and make it better
I'm also very interested in this concept.
The first step is to build candles. Here are some samples of that process:
I'm not sure if you saw the new Z = 1.000 in the freeware honeybadger; but the definition that mantifests sma's allows for float() inputs as periods for simple moving averages.
so Z allows you to scale your whole sma mesh to any floating point period large or small.
I was thinking a good test bed for this backtest/parameter optimization concept would be to use a barebones simple moving average cross; say 10/90; except with floating point period input
Then every tick the algo runs 3 backtest of the past 10,000 candles
Z = 0.99
Z = 1.00
Z = 1.01
then whichever backtest has the best result... the bot becomes retrained to buy/sell on the
Z*10 / Z*90 cross
Another milestone I made in this direction is
deep_c() which compiles the past 17,000 candles into a single list
so then you could break that list into blocks; each simulated tick:
pop and append
pop and append
pop and append...
on the subject of "parameter optimization"
Assuming you manifest candles using "deep_c"
You could run a live trader on 10m tick size... then run a backtest on every tick... changing the parameter by 1% on each tick... then tick after tick while live the engine could optimize for you.
Thanks for your suggestion. I am trying to do something help to optimize the parameters under guidance of automatic backtesting. Hope we will reach what we need.
Your answers are always inspirational! It seems there are multiple questions I should focus before building the program. I'll try my best.