[SHARE] Simple RSI BULL/BEAR strategy
(06-02-2018, 10:11 AM)dugu-dugu Wrote: Backtest for 3 months data shows 88% gain.
Big hmm.
I have backtest scripts that will do the testing on the last 3 months of data. I ran these parameters yesterday and they gave 88% gain. If I run them today, they give -20% loss. Looks like I need to clue myself in a lot more. How could just one day of difference in the data set give such antithetic results?
Code:
2018-06-02 13:33:18 start time:                      2018-03-01 00:01:00
2018-06-02 13:33:18 end time:                        2018-06-02 10:31:00
2018-06-02 13:33:18 simulated profit:                291.31763587 EUR (87.80181316%)

One day later:
Code:
2018-06-02 13:33:42 start time:                      2018-03-02 00:00:00
2018-06-02 13:33:42 end time:                        2018-06-02 10:31:00
2018-06-02 13:33:42 simulated profit:                -73.52482116 EUR (-20.82502157%)
  Reply
I have inserted a $DAYS ago parameter in my backtests. That is, if I find a set of parameters that give an acceptable return I run them with -90 to -10 days ago. That is, how much profit would they make if I started trading 90 days ago, 89 days ago.. 10 days ago. There are wild variations sometimes with a difference of just one day.

Code:
2018-06-09 14:57:49 CANDLE=20 DAYS=-90 SMA=251,21 BULL=14,85,39,5,-5 BEAR=14,41,19,14,-5 ADX=3,83,55 17.03159216 EUR (5.54738850%)
2018-06-09 14:58:37 CANDLE=20 DAYS=-83 SMA=251,21 BULL=14,85,39,5,-5 BEAR=14,41,19,14,-5 ADX=3,83,55 67.09564958 EUR (25.89765693%)
2018-06-09 15:00:25 CANDLE=20 DAYS=-65 SMA=251,21 BULL=14,85,39,5,-5 BEAR=14,41,19,14,-5 ADX=3,83,55 71.56031106 EUR (30.04589623%)
2018-06-09 15:01:57 CANDLE=20 DAYS=-45 SMA=251,21 BULL=14,85,39,5,-5 BEAR=14,41,19,14,-5 ADX=3,83,55 -102.90019638 EUR (-30.14860285%)
I guess you need to find some good parameters, run the strategy live for a long time and just hope you're lucky. The days of the yuge returns are gone forever, I believe. The 19k bitcoin was a black swan and it flew away for good.
  Reply
How can I debug my strategy, that is, display the current values of indicators in logs? I'm running gekko with pm2.

Something like:
Datetime: RSI Bull=current value, RSI bear=current value, ADX=current value

It's still pretty opaque for me how this works, I need to understand more of what's going on.
  Reply
Hey all,

I have been frustrated with this strategy, specifically not knowing why it is buying and selling at a loss all the time.  I tried to manual backtest and trace this strategy and I can understand how it works, but its still annoying that information like "is it buying in bull trend/is it selling in a bear trend", "What is the RSI when it bought" isn't readily available. I can have these info sent out to terminal, but I plan to run this headless and I don't want to SSH into it just to read the piped log file. So I modified the Pushbullet plugin (if you don't know what Pushbullet is, you should sign up any try it) so it will provide every bit of info that you need to understand why the bot acted the way it did.

[Image: qFZV40p.png]

Here's the Github repo if you want to try it.
https://github.com/crypto49er/RSI_Bull_B...ifications

Let me know if you have questions/issues. I will eventually make a version for the ADX strat. But honestly, in this market, doubt the ADX will be all that useful.
If it isn't crypto, it isn't worth mining, it isn't worth speculating.
https://www.youtube.com/c/crypto49er
  Reply
(06-23-2018, 02:29 AM)crypto49er Wrote: I have been frustrated with this strategy, specifically not knowing why it is buying and selling at a loss all the time...

Hello cryto49er, have your ever tried the gab tool by tommie to fine tune the parameters? At a first glance, it seems quite difficult to set up. But I think it may be helpful. Looking forward to see if you will do a video tutorial on that too Smile
  Reply
Yeah, I looked into gab a little bit. The hardest part is setting up the web server, followed by converting SQLite to MySQL.

If I spend a day or two on it, I'm sure I can figure it out. Just not sure if I have the time. xFFFFF's backtest tool works fine for me so the only reason why I want to setup GAB is to see if it has better output and if it is faster than xFFFFF's backtest tool. Are you able to get xFFFFF's backtest tool to work?
If it isn't crypto, it isn't worth mining, it isn't worth speculating.
https://www.youtube.com/c/crypto49er
  Reply
(06-23-2018, 04:02 AM)crypto49er Wrote: Yeah, I looked into gab a little bit. The hardest part is setting up the web server, followed by converting SQLite to MySQL.

If I spend a day or two on it, I'm sure I can figure it out. Just not sure if I have the time. xFFFFF's backtest tool works fine for me so the only reason why I want to setup GAB is to see if it has better output and if it is faster than xFFFFF's backtest tool. Are you able to get xFFFFF's backtest tool to work?

I watched your video about the xFFFFF backtest tool a while back and found it seems difficult to setup, especially my PC is a Windows. Meanwhile I simply used tradingview to visualize my RSIBB parameters and closely monitor how my bot is trading according to the market dynamics. This is a manual and time-consuming approach. But I found it made me understand more about the strategy...

In you youtube channel, I see you did spend quite some time on this gekko stuff. I believe you are getting closed to be successful. Never give up!
  Reply
(06-23-2018, 04:02 AM)crypto49er Wrote: Are you able to get xFFFFF's backtest tool to work?

I have installed the GAB by tommie and successfully run some backtests. The installation was not difficult at all. I used the XAMPP all in one pack for the php and pdo sqlite required, then unzip the GAB repo files to the web directory, copy the config file, and that's it! 

May be due to my Windows PC, I did some trouble shooting about the file system path in the config file. That was no big deal.

However, I am still not able to verify the backtest result. I am not sure if that's my configuration problem. I have summarized my findings, raised an issue at the GAB repo, and hopefully I can get tommie's reply and learn something from him.

Have a look if you're interested Smile

https://github.com/tommiehansen/gab/issues/21
  Reply
That's pretty cool that you got GAB up and running!

As for why GAB is totally different from Gekko's backtest results, I noticed in your screenshots in the issue you raise that GAB is running 5 minute candles, but its first trade is on the 6th minute, and all subsequent trades are 5 minute intervals but one minute off compare to Gekko.

You can adjust the the Date/Time range in Gekko and move the starting minute from 00 to 06 and you should be able to see similar results to GAB.
If it isn't crypto, it isn't worth mining, it isn't worth speculating.
https://www.youtube.com/c/crypto49er
  Reply
Good observation! The Gekko backtest has been re-run with the start time set as 00:06. Most of the roundtrips were then aligned, except the first trade is still different. I think one single trade should not make any significant difference to the overall backtest result...

GAB is not difficult to setup, easy to use and the UI is lovely. May be you can also check it out when you have time.
  Reply


Forum Jump:


Users browsing this thread: