cyberjunky / 3commas-cyber-bots

3Commas bot helpers, AltRank, GalaxyScore, Watchlists, Auto-Compound, TrailingStopLoss, TakeProfitIncrement
MIT License
210 stars 68 forks source link

Added support for different configurations per SO level #167

Closed mrcrdwd closed 1 year ago

mrcrdwd commented 1 year ago

Allow for using the same activation-percentage but with different settings per so-level.

The use case is when you, for instance, want to tighten the band between your take profit and stop loss when you take on more so levels.

The configuration below is now supported.

{"activation-percentage": "3.0","initial-stoploss-percentage": "-1.0","sl-timeout": "30","activation-so-count": "1","sl-increment-factor": "1.0","tp-increment-factor": "0.7"},
{"activation-percentage": "4.0","initial-stoploss-percentage": "-1.0","sl-timeout": "30","activation-so-count": "0","sl-increment-factor": "1.0","tp-increment-factor": "0.7"},
{"activation-percentage": "4.0","initial-stoploss-percentage": "-1.0","sl-timeout": "30","activation-so-count": "1","sl-increment-factor": "1.0","tp-increment-factor": "0.7"},

The script will use the LAST configuration entry that matches the current profit and so level conditions.

Example

The activation-percentage must be specified in an ascending order and so-count must also be specified in an descending order.

mrcrdwd commented 1 year ago

In hindsight, this could be improved even further by checking the max activation-percentage that matches the current profit. That way the order in the config file would be less important and less error-prone.