Skip to content

enums

Classes

BacktestSettings

Bases: NamedTuple

Settings for filtering the results of your backtest. The main purpose of this is to save on memory and also there is sometimes no point in wanting to see strategies that are negative gains or below a specific qf score because they are useless.

Parameters:

Name Type Description Default
gains_pct_filter float = -np.inf

Will not record any strategies whos gains % result is below gains_pct_filter

required
qf_filter float = -np.inf

Will not record any strategies whos qf score result is below the qf filter. qf_score is between -1 to 1,

required
total_trade_filter int = -1

Will not record any strategies whos total trades result is below total trades filter.

required

IncreasePositionTypeT

Bases: NamedTuple

The different ways you can increase your position

Parameters:

Name Type Description Default
AmountEntrySize int= 0

How much you want your position size to be per trade in USDT

required
PctAccountEntrySize int = 1

If you have an equity of 1000 and you want your pct account entry size to be 1% then that means each trade will be a position size of 10 usdt

required
RiskAmountEntrySize int = 2

How much you will risk per trade. You must have a stop loss in order to use this mode.

required
RiskPctAccountEntrySize int = 3

How much of your account you want to risk per trade. If you have an equtiy of 1000 and you want to risk 1% then each trade would be risking $10. You must have a stop loss in order to use this mode

required
SmalletEntrySizeAsset int = 4

What ever the exchange smallest asset size is that is what your position size will be for each trade. Let's say the smallest is .001 for btcusdt, then each trade will be worth .001 btc

required

LeverageStrategyTypeT

Bases: NamedTuple

Choosing which leverage strategy you would like to use.

Parameters:

Name Type Description Default
Dynamic int = 0

This will automatically adjust your leverage to be .001 percent further than your stop loss. The reason behind this is to that it will keep your used cash amount down as much as possible so you can place more trades on the same or other assets.

required
Static int = 1

Static leverage

required

TakeProfitStrategyTypeT

Bases: NamedTuple

How you want to process the take profit

Parameters:

Name Type Description Default
RiskReward int = 0

Risk to reward

required
Provided int = 1

Your strategy will provide the exit prices

required
Nothing int = 2

No take profits.

required