08-27-2018, 11:49 AM
Trailing stops have now in develop! I did some initial testing but please consider this very experimental at this stage.
- How to add a trailing stop loss to a strategy: https://gekko.wizb.it/docs/strategies/cr...k-function
- New trigger events available to plugins: https://gekko.wizb.it/docs/internals/eve...ated-event (triggerCreated, triggerFired and triggerAborted).
Trailing stop losses as implemented in Gekko trail a fixed amount: if you trade BTC and you go in @7000 you can set the trailValue to 50 to create a stoploss at 6950. It will move up together with the price, but never down -> after the price goes to 7050 you are in profit (minus fees and execution risk).
But because most people write strategies and try them out on a bunch of markets (USD/BTC, USD/ETH, BTC/ETH) requiring strategies to set this to a fixed number (of 50 for example) would only really work for USD/BTC but not for BTC/ETH (since the price is 0.10, what does 40 even mean). For those reasons Strategies can simply pass a percentage which Gekko will convert on creation to a fixed number).
- How to add a trailing stop loss to a strategy: https://gekko.wizb.it/docs/strategies/cr...k-function
- New trigger events available to plugins: https://gekko.wizb.it/docs/internals/eve...ated-event (triggerCreated, triggerFired and triggerAborted).
Quote:The Stratrunner outputs "Trailing stop trail value specified as percentage, setting to: 40.8204". What does this value 40.8204 mean? This test uses a SL with 4.6%
Trailing stop losses as implemented in Gekko trail a fixed amount: if you trade BTC and you go in @7000 you can set the trailValue to 50 to create a stoploss at 6950. It will move up together with the price, but never down -> after the price goes to 7050 you are in profit (minus fees and execution risk).
But because most people write strategies and try them out on a bunch of markets (USD/BTC, USD/ETH, BTC/ETH) requiring strategies to set this to a fixed number (of 50 for example) would only really work for USD/BTC but not for BTC/ETH (since the price is 0.10, what does 40 even mean). For those reasons Strategies can simply pass a percentage which Gekko will convert on creation to a fixed number).