i find the bot algorithm can be much more improved, the focus is into get bitcoins, not FIAT, we must asume the bitcoin pirce will always go up in the long term.
so
there must be an option called " % drop "
so you can put there for example: "10%"
and when EMA lines configuration trigger a sell, then the bot will buy again when one of the next events its done:
1º if EMA lines crosses back then buy to cut losses.
2º if 10% price drop is achieved then sell all, don't be greedy waiting EMA linea crosses back because you might end up loosing bitcoins
also can be improved further just buy putting a second "% drop"
1º - 10%
2º - 20%
this way, in the first non greddy event that the market price drops a 10% you buy with 90% of your money
and if EMA lines are not crossing back, then you still have a 10% of cash to buy back more bitcoins in case it drops further.
if it dont drop further, then EMA lines will cross back and that 10% will be used to buy back at the current price waiting a new drop trend
the market price must be monitorized in real time, end EMA events in a period of time...
Let me know when your bot is ready for testing, I will buy it.
