Does anyone know how to make the "reward" into number of profitable trades? So basically instead of like total profit, or sharpe ratio or consistency, I want to make it so that it a) is profitable (so if you lose money over the whole backtest it doesn't count), and b) has a good ratio of profitable trades to losing trades.
I'm basically working on a project for research where I make a trading system which just sort of makes a little profit here and there, rather than trading constantly.
@d416 How can I go about changing the performance measure? I'm going to start digging for it, but just thought I'd ask to maybe save some time :)
hghhgghdf dfdf last edited by
@Wayne-Filkins-0 pass whatever you want to optimize to the maximize function. So for your case, you could multiply a binary value (profitable/unprofitable) by the percentage of profitable trades and pass that to the gen-opt function
d416 last edited by
This is a super simple method of using cash in the account as a measure of performance, but the true BT way would be use Analyzers https://www.backtrader.com/docu/analyzers/analyzers/
@d416 In your optunity script, if you want to change the parameters to decimal numbers like 0.1 - 2.6 or something, do you just type them as decimal range and it just knows to search all decimals? Or do you have to do something else?
rajanprabu last edited by
somethig like this..
import numpy as np param=np.arange(0.1, 0.9, 0.05)