iterativv / NostalgiaForInfinity

Trading strategy for the Freqtrade crypto bot
GNU General Public License v3.0
1.92k stars 482 forks source link

At least X profit before exit #362

Closed godshades closed 6 months ago

godshades commented 6 months ago

Hi, i want to set at least 10% profit before execute any exit logic, what code should i modify in X4 Thanks

LastC0der commented 6 months ago

It will be enough to add the following two lines to the configuration file. (I think 10% is too high a value, it may not be efficient for you.)

"exit_profit_only": true,
"exit_profit_offset": 0.1,

https://www.freqtrade.io/en/stable/configuration/#parameters-in-the-strategy exit_profit_only : Wait until the bot reaches exit_profit_offset before taking an exit decision. Strategy Override.Defaults to false. Datatype: Boolean

exit_profit_offset : Exit-signal is only active above this value. Only active in combination with exit_profit_only=True. Strategy Override. Defaults to 0.0. Datatype: Float (as ratio)

I also recommend you to look at the Hold Trades feature in the NFI Specific Configs section of the wiki. https://github.com/iterativv/NostalgiaForInfinity/wiki/NFI-Specific-Configs

godshades commented 6 months ago

@LastC0der thank you so much