[SHARE] Simple RSI BULL/BEAR strategy
(04-05-2018, 04:08 AM)jvs Wrote: So this bear market just keeps on bearing huh.

I re-ran my brute force test on the period between 15th Feb and 1st April ... afraid not one combination made a profit. This current bear market is pretty tough on trading algorithms.

I started a live trading version of this strategy using optimized settings from my 'brute force' tests on 5 USDT markets (ETH, ETC, BCH, BNB, LTC..basically all the USDT pairs on Binance) on the 27th of March.
Since then, my portfolio has gone up by... 0.1% !  It went down as a low as -4.6% but has since recovered back to pretty much break even.

I still consider this a win really, considering the overall market has fallen some 17% in that time.

If you're at +0.01% and the market is around -17% you've still beaten the market by over 17%.
You're one of the few that understands that it is a win though. Smile

Here's a screen of over 4000 runs using RBB ADX on BNB-USDT between 2018-01-01 and 2018-02-01 using my GAB-tool:
https://imgur.com/a/K3O8s
  Reply
Hi, I'm trying new RSI_BULL_BEAR_ADX, but it does not work. I have this error. Where i have mistake?
Code:
2018-04-05 21:24:14 (INFO):     Setting up Gekko in backtest mode
2018-04-05 21:24:14 (INFO):
2018-04-05 21:24:14 (INFO):     Setting up:
2018-04-05 21:24:14 (INFO):              Trading Advisor
2018-04-05 21:24:14 (INFO):              Calculate trading advice
2018-04-05 21:24:14 (INFO):              Using the strategy: RSI_BULL_BEAR_ADX
 xxx POST /api/backtest 500 491ms -

 Error: non-error thrown: Child process has died.
     at Object.onerror (/home/gekko/node_modules/koa/lib/context.js:105:40)
     at <anonymous>
     at process._tickCallback (internal/process/next_tick.js:188:7)
  Reply
Can someone help me how to define the gekkoga config for RSI_BULL_BEAR?

How to set the right values here:

---snip end of the config---

 candleValues: [5],
 getProperties: () => ({

   historySize: randomExt.integer(1000, 100),

   short: randomExt.integer(15,5),
   long: randomExt.integer(40,15),
   signal: randomExt.integer(12,6),

   thresholds: {
     up: randomExt.float(20,0).toFixed(2),
     down: randomExt.float(0,-20).toFixed(2),
     persistence: randomExt.integer(9,0),
   },

   candleSize: randomExt.pick(config.candleValues)
 })
};


I want to fill in something like:

# SMA Trends
SMA_long = 1000;100
SMA_short = 100;20
 
# BULL
BULL_RSI = 7;15
BULL_RSI_high = 40;100
BULL_RSI_low = 30;90
 
# BEAR
BEAR_RSI = 10;20
BEAR_RSI_high = 40;60
BEAR_RSI_low = 10;50
 


Thank you!

@tommiehansen is you GAB-tool public? :-)
  Reply
Okay, I got it.

Here an example for all of you:
Just look in the toml file of the strategy and then file the vars with values you want to test..

SMA_long: randomExt.integer(500,10),
SMA_short: randomExt.integer(50,20),


BULL_RSI: randomExt.integer(15,5),
BULL_RSI_high: randomExt.integer(80,80),
BULL_RSI_low: randomExt.integer(60,60),


BEAR_RSI: randomExt.integer(15,15),
BEAR_RSI_high: randomExt.integer(60,60),
BEAR_RSI_low: randomExt.integer(20,20),
  Reply
Here's an article with some ideas on optimization:

http://mechanicalforex.com/2010/10/optim...ation.html

Notice he suggests using lots of data ... preferably 9 to 11 years worth!  So we're at a bit of a disadvantage.

Some sort of stop loss seems necessary.  Losses should never get quite that large!  Even if it damages your magical (absurd?) back testing score.
Remember, back testing is not real.  It's just a guess.  The real world will throw you curves every time.  New price action never seen before, etc.

So testing and using an accumulation of trades as your primary score is a very bad idea.  That will lead to curve fitting your test data.

Number of wins vs. number of losses.  Average win vs. average loss.  Largest loss.  Greatest number of losing trades in a row.  These are important.

You're building a weapon to use against an enemy you've only heard about and never seen before.  Keep that in mind.  Optimizing to fractional perfection is wishful thinking.

Thanks.
  Reply
(04-09-2018, 01:51 AM)richard Wrote: Here's an article with some ideas on optimization:

http://mechanicalforex.com/2010/10/optim...ation.html

Notice he suggests using lots of data ... preferably 9 to 11 years worth!  So we're at a bit of a disadvantage.

Some sort of stop loss seems necessary.  Losses should never get quite that large!  Even if it damages your magical (absurd?) back testing score.
Remember, back testing is not real.  It's just a guess.  The real world will throw you curves every time.  New price action never seen before, etc.

So testing and using an accumulation of trades as your primary score is a very bad idea.  That will lead to curve fitting your test data.

Number of wins vs. number of losses.  Average win vs. average loss.  Largest loss.  Greatest number of losing trades in a row.  These are important.

You're building a weapon to use against an enemy you've only heard about and never seen before.  Keep that in mind.  Optimizing to fractional perfection is wishful thinking.

Thanks.

This thread does not really deal with backtesting philosophy or best practices though, that's an entirely different topic.
This is just one tool, how people use (or abuse...) it is something completely different.
  Reply
(04-09-2018, 02:05 AM)tommiehansen Wrote: This thread does not really deal with backtesting philosophy or best practices though, that's an entirely different topic.
This is just one tool, how people use (or abuse...) it is something completely different.

Sorry, didn't mean to hurt your feelings.  Was just trying to help.

When you decide not to include a stop loss or you optimize in some way then that's just what you're doing.

You can't build a strategy without dealing with 'philosophy' and best practices.  Unless you're not intending to trade live.
Sorry, maybe that's what you meant.

If it's just a game then you can ignore these other issues.

Richard
  Reply
(04-09-2018, 04:47 AM)richard Wrote:
(04-09-2018, 02:05 AM)tommiehansen Wrote: This thread does not really deal with backtesting philosophy or best practices though, that's an entirely different topic.
This is just one tool, how people use (or abuse...) it is something completely different.

Sorry, didn't mean to hurt your feelings.  Was just trying to help.

When you decide not to include a stop loss or you optimize in some way then that's just what you're doing.

You can't build a strategy without dealing with 'philosophy' and best practices.  Unless you're not intending to trade live.
Sorry, maybe that's what you meant.

If it's just a game then you can ignore these other issues.

Richard

If you would have read the thread you would have seen that several attempts at stoplosses has already been made. None have been successful
and this for quite obvious reasons if one would care to understand the underlying code. There are however versions with stoplosses floating around, feel free to download those or even better -- contribute by adding it yourself.
  Reply
Interesting strategy! indeed Smile

Thank you so much for this gem!

I wish i could code...really! i was thinking about this in my head about going back and forth BEAR/BULL

I bow!

i ran the RSI_BULL_BEAR_ADX strategy without the mod_high and mod_low under [BULL] but [BEAR] has it .. and it made a better result Smile

USD ETH Kraken 1 Year 3 Months .

it's late, good night and THANK YOU!
  Reply
(04-09-2018, 10:17 AM)tommiehansen Wrote: If you would have read the thread you would have seen that several attempts at stoplosses has already been made. None have been successful
and this for quite obvious reasons if one would care to understand the underlying code. There are however versions with stoplosses floating around, feel free to download those or even better -- contribute by adding it yourself.

Yes, I did read the whole thread.  That's why I said what I did.  I saw that you had tested and rejected stop losses.

I'm trying to suggest that better metrics for testing and scoring results may be helpful.

Most importantly, I think the 'Simulated Profit' number is leading you astray.  It creates a level of excitement and a view of the results that is dangerous and counter-productive.

Let's say you back-test using a year's worth of historical data.  And you fine-tune until you have a nice large 'Profit' showing.  If you start trading live, and the market perfectly repeats itself you're going to be laughing all the way to the bank!  But that's simply never going to happen.

There are so many ways of looking at this.  Consider the big chart view of the whole year.  That's the best information we have, okay.  But what about those sections of that year that your system didn't handle very well?  What if that's what the market hands you when you first start trading live?  (Assuming the future actually mirrors the past in some way.)

What if the market repeats several of your back-test's worst weeks in a row?  Will you still have an account to trade?  Or will you lose everything?

Optimizing for a large period of time and ignoring strings of draw-downs within it because the final 'Profit'  is as big as you can get it is probably not a very good idea.


If we're lucky the market will replay some of the days or weeks from our historical data.  Maybe not.  But if we ignore or downplay some of those periods, assuming or hoping they won't bite us at the wrong time is probably not a good idea.

Trading, like running a profitable casino, is a probability game.  You try to keep the numbers in your favor.  And manage your risk according to your assets.

If you have a large draw-down at the wrong time it could potentially knock you out of the game entirely.  Or at least make your eventual success much more difficult.

I don't know the best way to do this.  But looking carefully at the worst weeks or months in your year of backtesting seems very important.  Unless you're feeling lucky.  :-(

This is just one way of looking at the problem.  There are many others.

Trading without a stop-loss, especially in automated trading, seems too much like wishing upon a star.

That's my opinion, which I'm sharing with you because I appreciate your point of view and I want you to do well.

A classical stop-loss is one of many ways to control your losses.  My intent was to draw attention to those losses more than to suggest a specific solution.

Should I actually come up with a strategy that seems viable I will share it.  I've written automated trading systems in the past and managed to break even, which isn't nearly good enough.  I made mistakes.  I'm trying to learn from them.

Your strategies seem close to perfect.  They seem workable in every market you can apply them to.  It's the tuning that may need some adjusting.  It's a tricky endeavor maximizing profits and minimizing losses in a future market that's bound to be different from the past.  There is no guarantee of success.  At least not without access to a time machine. :-)  (Anyone have data for 2019?)

Thanks very much for your efforts.

Richard
  Reply


Forum Jump:


Users browsing this thread: