New strategy : RSI_BULL_BEAR_ADX_PINGPONG_PEEKTREND
#1
Star 
I extended  a strategy  named "RSI_BULL_BEAR_ADX_PINGPONG" with _PEEKTREND

You can find the code originally written by Tommie Hansen and Rafel Martin (CC-BY-SA 4.0)
And adjusted by me here :   https://github.com/PGTBoos/GekkoStrategies

About    _PeeKtrend
Most stoploss functions I've seen just get out of the market if the price is below a percentage or a fixed amount, of the original bought price.
Well, I'm no great fan of that, there is nothing wrong about going short, (as it can allow for a new long from a lower start).
However I don't want to go down the whole ride again, or just less of it.

So PeekTrend keeps track of the highest price since you went long. 
The highest price named MaxPeekClose is calculated as :     ( candle.close * closeRatio + candle.high *highRatio) / (closeRatio+HighRatio)
Then short depends upon  candle.close < MaxPeekClose * peekPercentage + peekShift
This is logged to the gekko console as well as escaped failing trend with some additional data.
I log that to console since if it happens to frequent the other code wont kickin there should be some balance between this and that to get it good working.

If no short happens then the original code continuous trading
   (the greens are on top of the TOML file )

The above math still can loose you money as its not a HODL, but one might escape earlier.
If sudden price spikes happen (but you missed them) and shortly after the price falls deep.
Then the peeks raised the upper bar and so you can have some part of the peak (instead of the deep fall).
Where the original code didn't.


at the bottom of the post, there is a screenshot of the code in a market that went slightly down the TOML provided was unaltered
So under the same conditions, you get the same.

Oh well but essentially this is where you come in !!!!
Please  test it, find better settings or alter it, and let others now here  
For those who want to alter the code
I placed a small note in the check function maybe you can help me with that.


I could improve PeekTrend function even more if somehow I could retrieve the price at which a long was really buying coins, ea not the last close.
So if you know how to let me know, please.

side note, I noticed the code can be configured to work well with various time ranges.

[Image: RSI_BULL_BEAR_ADX_PINGPONG_PEEKTREND.PNG]



(oh and wow after a lot of hacking managed to run GEKKO normally on windows without BASH ! ... see other threads here for that ).
  Reply
#2
Thank you for sharing your strategy with us.  All minds are better than one!  Can't wait to try this out myself, I'll report back results and trading pairs I found it best on.  Keep up the hard work (and more importantly, sharing it with the community!)
  Reply
#3
Just a heads up, your zip download at GitHub is flagging antivirus as a threat. not sure what part of it is
  Reply
#4
(09-03-2019, 05:22 AM)@b071 Wrote: Just a heads up, your zip download at GitHub is flagging antivirus as a threat. not sure what part of it is

Sorry for late reply i had a small vacaction.

It's because javascript files are under the right conditions executable, with the right additional software (like having nodeJS).
The same would most likely happen if i would upload .vbs file or an exe file.

On Github You can look at the code yourself as well before you download as essentially .js files are 'naked' its not compiled / encryptrd code.
I can asure you though that I dont write viruses, if there where a virus you should contact github then there would be something wrong with their zipper (but its fine).

Most likely you have very protective antivirus settings (which is a good thing) that doenst trust .js and .vbs .bat .cmd  etc, just know what you do.
The filles there are only usuable inside Gekko in the right folder, they can do nothing without gekko.
  Reply
#5
Thanks for this strat mate testing it at the moment, doesn't seem to buy a lot though? I'm still new to gekko and trading in general how often should it make trades?
  Reply
#6
(09-12-2019, 07:20 AM)Stixx Wrote: Thanks for this strat mate testing it at the moment, doesn't seem to buy a lot though? I'm still new to gekko and trading in general how often should it make trades?

That differs a lot on what you trade your market and how long you trade and what settings you use.
The strategy was allready known for trading nice in bear markets.
It was one of my first strategies that i extended with a certain kind of stoploss.
Originally people believed that stoploss didnt work well with this strategy
But i noticed it can work as well... you got to tweak it to make profit for your situation.
Knowing that it can make profit, i think you should just play with it to see it.
And maybe you learn a bit of coding and trading while your playing with it.
You will have to learn to code when you dive into Gekko.

(note that 1 hour trading does not mean each hour there is trading, it means each hour price levels are compared against previous hour).
  Reply
#7
Thanks for replying mate, yes agreed I have a lot to learn about trading and gekko but so far I find it very interesting. I have been using 5min candles on btc/gbp but will play around some more with settings.

Thanks
  Reply
#8
(09-12-2019, 11:28 AM)Stixx Wrote: Thanks for replying mate, yes agreed I have a lot to learn about trading and gekko but so far I find it very interesting. I have been using 5min candles on btc/gbp but will play around some more with settings.

Thanks

my experience is that gekko strategies often dont work well at that time range (most of the time).
[....Resistance is futile...]
  Reply
#9
(09-12-2019, 01:06 PM)PGTART Wrote:
(09-12-2019, 11:28 AM)Stixx Wrote: Thanks for replying mate, yes agreed I have a lot to learn about trading and gekko but so far I find it very interesting. I have been using 5min candles on btc/gbp but will play around some more with settings.

Thanks

my experience is that gekko strategies often dont work well at that time range (most of the time).
Do you suggest longer times like 1 hour?
  Reply
#10
(09-12-2019, 01:18 PM)Stixx Wrote:
(09-12-2019, 01:06 PM)PGTART Wrote:
(09-12-2019, 11:28 AM)Stixx Wrote: Thanks for replying mate, yes agreed I have a lot to learn about trading and gekko but so far I find it very interesting. I have been using 5min candles on btc/gbp but will play around some more with settings.

Thanks

my experience is that gekko strategies often dont work well at that time range (most of the time).
Do you suggest longer times like 1 hour?

Might work not tested, although 1 hours are often working well, personally i'd like a strategy to evaluate more often 5 or 10 minutes.
Its all backtesting tuning and coding, but so far for 5 minutes i've not got something good yet, although my latest project seams quite OK.
I'm several versions ahead with it now ( VmaPredict currently version 5,  VmaPredict5 and 6 is in the making), i have not tested that algorythm with shorter periods
It might behave or miss behave, but surely i'm keen to know with settings will work with 5 minutes interval (pure theoretically, something must work for that too)..

I leave testing to you people so i can focus on coding and improving it (in return i'd like people to post their best results with it).
Testing all variable combinations takes to much time to me, i code generaltrading ideas (and my own ideas), without thinking of time frames in which they are used.

For example a short moving average might in some strategies be 7 days, or 7 hours , or 7 minutes... principles often stay the same, (though brake points, and tresholds and profits differ).
if one creates a rule (weird rule) buy if moving average is below RSI 20.. thats why tuning and exploring needs to be done, and why i dont have answers to optimal settings.

BTW i have quit improving RSI_BULL_BEAR_ADX_PINGPONG _PEEKTREND, it will stay like that (it was a small extension to something that allready exists).
In contrast VmaPredict is new (not based upon code of someone else), and that whole code base is much more easy to extend and improve upon.
In fact its now near 300 lines of code, so its evolving bigger and becomming better.
[....Resistance is futile...]
  Reply


Forum Jump:


Users browsing this thread: