Added dual stoploss to RSI_BULL_BEAR_ADX - Printable Version +- Gekko Forum (https://forum.gekko.wizb.it) +-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html) +--- Forum: Strategy Development (https://forum.gekko.wizb.it/forum-12.html) +--- Thread: Added dual stoploss to RSI_BULL_BEAR_ADX (/thread-57992.html) |
Added dual stoploss to RSI_BULL_BEAR_ADX - PGTART - 08-24-2019 I extended a known script called: RSI_BULL_BEAR_ADX In such a way that it has two stoploss settings, one for Bull and one for Bear markets. However now i am wondered about generic stoploss math, as in other strategies. Most of the times i see some percentage of the last long candle close buy to not go below that. Sometimes i see people using a stoploss with a fixed amount, say 50 dollar or so, since last long candle close. But i'm wondered I could also code to memorize the highest and lowest candle stops - since - my last long bu advice. So create a stoploss that would stop after the highest values since my last buy would drop more then a certain percentage I dont know enough of the background ideas behind RSI_BULL_BEAR_ADX if that would make sense or not. And am worried if that would be an antipatten to code in regards to the ADX part of it. What do you people think of alternative stoploss rules ? And maybe you know of perhaps more afvanced stoploss rules ? perhaps nice to see some logging of the not yet ready code as want validate it a bit more first : I log to console: Bear long at 9592 stoploss: bear<9113 bull< (misssing) // missing is bug Bear short Bull long at 9883 stoploss: bear<9389 bull<9834 // after each long i recalculate bot stoplosslevels so i can swing from bear/bull markets Bull stoploss triggered on 9775 Bullstop was 9786 Bull long at 10450 stoploss: bear<9928 bull<10398 Bull stoploss triggered on 10483 Bullstop was 10537 Bull long at 10564 stoploss: bear<10036 bull<10511 Bull stoploss triggered on 10501 Bullstop was 10511 Bull long at 10838 stoploss: bear<10296 bull<10783 Bull stoploss triggered on 10777 Bullstop was 10848 //interesting making profit from bull to bear market. Bear long at 9673 stoploss: bear<9189 bull<(missing) Bear short RE: Added dual stoploss to RSI_BULL_BEAR_ADX - PGTART - 08-25-2019 (08-24-2019, 11:14 AM)PGTART Wrote: I extended a known script called: RSI_BULL_BEAR_ADX oh well it wasnt that difficult to extend my code just going to test : Code: if (this.price>this.maxcandleclose) //lifting the bearstop to last highest BTW it works quite well, beeing able to have different stoplosses for bear and bull markets. RE: Added dual stoploss to RSI_BULL_BEAR_ADX - dodobird - 09-26-2019 Can you share the code? I don't seem to know how to add it? RE: Added dual stoploss to RSI_BULL_BEAR_ADX - Hallonstedt - 09-27-2019 I have a value called backStop that follows ema(10) in up-trend but cannot go down until i go long the next time. This way, I can calculate the delta between my backStop value and the current candle close during bear market. If the gap gets too wide, I go short. RE: Added dual stoploss to RSI_BULL_BEAR_ADX - PGTART - 09-29-2019 (09-26-2019, 01:41 AM)dodobird Wrote: Can you share the code? I don't seem to know how to add it? https://github.com/PGTBoos/GekkoStrategies |