02-01-2018, 03:02 AM
(This post was last modified: 02-01-2018, 03:03 AM by tommiehansen.)
What you're looking for is basically a trailing stoploss. I have no idea how to implement that in Gekko but if i were to code it in pure js i would just set this trail (which would consist of the current price) everytime a long position is taken and then check it on every candle etc. The logic is quite basic.
Doesn't need to be that fancy, just needs this:
1. A new option in the TOML-file so that it can be configured
2. It need to be percentage based (since anything else would be awful); so need to calc percentage between current price and old price (trail)
3. If executed the rest of the stuff should obviously stop until next candle (at least)
Edit: Tried that other trail with USD-BTC-data at 1 year and 8 months @ 11 min but my Gekko is just crashing with that amount of data.
Edit 2: You really need to test with more data when you test. 1 month is hardly enough. :-)
Doesn't need to be that fancy, just needs this:
1. A new option in the TOML-file so that it can be configured
2. It need to be percentage based (since anything else would be awful); so need to calc percentage between current price and old price (trail)
3. If executed the rest of the stuff should obviously stop until next candle (at least)
Edit: Tried that other trail with USD-BTC-data at 1 year and 8 months @ 11 min but my Gekko is just crashing with that amount of data.
Edit 2: You really need to test with more data when you test. 1 month is hardly enough. :-)