01-03-2019, 05:28 PM
Quote:Regarding 1.: It would be great if one could control the triggers for already given advice, I agree. Do you see currently (with 0.6.8) any way for me to tap into that and manipulate for example the percentage of an existing trailing stop loss (maybe even by extending the current Gekko behavior)? Lets say, I initiate always the trailing stop loss for every long advice, so the trigger exists, however start with a large percentage and gradually want to decrease it?
This would be pretty hard, since the trailing stop is managed by a different part of the codebase (inside Gekko Broker). The trailing stop code supports adjusting the trail: https://github.com/askmike/gekko/blob/65...top.js#L38
But that needs to be glued through a few components so your strategy can pass a message there. A message needs to flow from:
- your strategy
- tradingAdvisor plugin
- [ new gekko event ] - see here: https://gekko.wizb.it/docs/internals/events.html
- the trader plugin
- into the trailing stop
If we go this route I want to completely detach the creating of a trailing stop with the triggering of a long signal (we can still support current behavior to keep everything backwards compatible).
Quote:2. Thank you for your explanations. Yes it would be possible for me to use a shorter interval and monitor the price. As I understood the trailing stop loss is using the live price and not the candle updates to trigger the stop. I was aiming for something similar to buy that uses the live price, so is even fast than the candle updates and automatically triggers when the price moves up a specific percentage/value.
Gekko strategy interface is very simple by design, the only lever you have is the candleSize (with a minimum of once per minute). Note that "live trailing stop" that Gekko supports isn't low latency either, it polls pretty slow once every few seconds max: https://github.com/askmike/gekko/blob/de...ger.js#L41
---
Gekko really isn't designed for low latency stuff. I want to move towards native stop losses for exchanges that support them, that doesn't require any effort on Gekkos part.