Bitcoin Forum
May 08, 2024, 03:56:16 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 [14] 15 »  All
  Print  
Author Topic: Wouldn't it be nice... (the LazyWhale algorithm)  (Read 24643 times)
NotLambchop
Sr. Member
****
Offline Offline

Activity: 378
Merit: 254


View Profile
January 28, 2015, 03:48:34 PM
 #261

^I see what you did there...



Nope, still not gonna work Cheesy
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715140576
Hero Member
*
Offline Offline

Posts: 1715140576

View Profile Personal Message (Offline)

Ignore
1715140576
Reply with quote  #2

1715140576
Report to moderator
1715140576
Hero Member
*
Offline Offline

Posts: 1715140576

View Profile Personal Message (Offline)

Ignore
1715140576
Reply with quote  #2

1715140576
Report to moderator
mmitech
Legendary
*
Offline Offline

Activity: 1148
Merit: 1001


things you own end up owning you


View Profile
January 28, 2015, 03:51:32 PM
 #262

Alright. Initially, when people asked how the algorithm works internally, I refused to specify it any further. Now that nobody cares anymore, here's the basic idea ^_^

Note: I'm not going to fill in the exact numerical parameters of the the technical/indicator signals. No need to encourage frontrunning. But in principle, with the details I'm about to give, you could find your own (and probably very similar) parameters by training the individual parts over the market data that is the same for everyone.

The trade signals of this algorithm are a complex condition based on three technical signals.

Signal #1, the "main" signal, is a medium term momentum signal. Think "daily EMA20+10 crossover", but the average I use is instead a Hull type average (and the parameters are obviously not 20/10).

Important to note here: signal #1 is symmetric wrt 'buy' and 'sell'.

If used alone, signal #1 is profitable over the global bitcoin history (GX, BS, BF), and roughly uniformly profitable as well. However, it yields slightly too many trades, and tends to sell too early during major rallies. So, it is not the desired signal yet that only sells when it really has to.

Signal #2 is a short-term momentum signal. It acts as a filter applied to #1. Think of it as an "optimal entry/exit" filter. It cannot initiate additional trades by itself, it can only delay a trade based on signal #1. It is basically capturing the idea: if the medium term is up, but the short term is drastically down, better wait a bit before you buy (similar for delaying a sell trade). Signal #2 is buy/sell symmetric as well, and I don't really think it is problematic (also, leaving it out doesn't change the results from a pure signal #1 strategy much).

Signal #3 is the tricky one. You could call it the "bubble filter". Just like #2, it doesn't do anything other than (possibly) delay signals coming from #1, i.e. it doesn't add to the total number of trade signals but only *reduces* them under certain conditions.

It defines certain market conditions (think: long term momentum) to be so strongly bullish that a mid-term momentum signal from #1 that says 'sell' should be ignored for the moment, until either the mid term is up again, or the market condition becomes less bullish, in which case the 'sell' goes through.

And here's the tricky bit. Signal #3 is not buy/sell symmetric. It only delays 'sell' trades, but not 'buy' trades, in case the long term momentum is flipped around

I know. That buy/sell asymmetry is a big violation of all that is holy in algorithmic trading. Reeks of overfitting.

Still, given the history of the Bitcoin market so far, I can see some justification for it. It works well for 2011, 2012, 2013. In 2014, it still works well enough for the first half, but from then on, it's not really justified anymore.

I guess it all depends now if Bitcoin will ever go through a significant bull market again, and when. Let's say it does ("Bitcoin is dead" users need not reply Cheesy). That still doesn't mean that the exact parameters of the "bubble filter" are optimal, but it's probably not going to be the millstone around the algorithms neck that it is right now, delaying sell signals when it really shouldn't.

In a way, I'm making a human choice for my algorithmic method here: the assumption, that in the long run, it is better to err on the side of buying than on the side of selling - a choice that is justified by the global history of the market, but not by the more local one.

Comments welcome.

Can I take a look at the code ? maybe if you upload it on Github you will get some contribution which will help make it work better algorithm ?
oda.krell (OP)
Legendary
*
Offline Offline

Activity: 1470
Merit: 1007



View Profile
January 28, 2015, 03:57:28 PM
 #263

Can I take a look at the code ? maybe if you upload it on Github you will get some contribution which will help make it work better algorithm ?

Thanks, but the code is fine, I'm pretty sure. Nothing complicated either. It's about the filtering condition #3. Is there any justification to asymmetrically delay sells but not buys. Generally, the answer is no. I do it anyway, cause on a long enough time frame I'm bitcoin bullish, I guess.

Not sure which Bitcoin wallet you should use? Get Electrum!
Electrum is an open-source lightweight client: fast, user friendly, and 100% secure.
Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
oda.krell (OP)
Legendary
*
Offline Offline

Activity: 1470
Merit: 1007



View Profile
January 28, 2015, 04:06:03 PM
 #264



Harsh, man. I'm not exactly claiming to have invented a perpetuum mobile of trading. In fact, the engine's kind of sputtering right now Cheesy

Not sure which Bitcoin wallet you should use? Get Electrum!
Electrum is an open-source lightweight client: fast, user friendly, and 100% secure.
Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
NotLambchop
Sr. Member
****
Offline Offline

Activity: 378
Merit: 254


View Profile
January 28, 2015, 04:18:07 PM
 #265

^Just meant that (at first glance) it seemed to be overly complex.  Didn't fully grasp what you were trying to do, though.  It would probably be a bit easier if you posted something like pseudocode, like mmitech suggested.
oda.krell (OP)
Legendary
*
Offline Offline

Activity: 1470
Merit: 1007



View Profile
January 28, 2015, 04:53:07 PM
 #266

^ Right. Good point.


average-fast = f(x)
average-fast-sig = f'(x)

average-mid = g(x)
average-mid-sig = g'(x)

average-slow = h(x)
average-slow-sig = h'(x)

sig-1 := if average-mid > average-mid-sig, buy. if average-mid < average-mid-sig, sell.

sig-2 := if average-fast > average-fast-sig, buy. if average-fast < average-fast-sig, sell.

sig-3 := if average-slow < average-slow-sig, sell.

trade-signal := if sig-1 == sig-2 == sig-3 == sell, sell. if sig-1 == sig-2 == buy, buy. o/w, do nothing.


To be clear, the final trades are based on the combined 'trade-signal' condition.

Not sure which Bitcoin wallet you should use? Get Electrum!
Electrum is an open-source lightweight client: fast, user friendly, and 100% secure.
Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
mmitech
Legendary
*
Offline Offline

Activity: 1148
Merit: 1001


things you own end up owning you


View Profile
January 28, 2015, 05:05:50 PM
 #267

^ Right. Good point.


average-fast = f(x)
average-fast-sig = f'(x)

average-mid = g(x)
average-mid-sig = g'(x)

average-slow = h(x)
average-slow-sig = h'(x)

sig-1 := if average-mid > average-mid-sig, buy. if average-mid < average-mid-sig, sell.

sig-2 := if average-fast > average-fast-sig, buy. if average-fast < average-fast-sig, sell.

sig-3 := if average-slow < average-slow-sig, sell.

trade-signal := if sig-1 == sig-2 == sig-3 == sell, sell. if sig-1 == sig-2 == buy, buy. o/w, do nothing.


To be clear, the final trades are based on the combined 'trade-signal' condition.

ah OK, so it is not a code, it is kind of a logic you have there, and do you daily pull the data and calculate it manually? if yes, then where from and how do you get that data?
oda.krell (OP)
Legendary
*
Offline Offline

Activity: 1470
Merit: 1007



View Profile
January 28, 2015, 05:09:44 PM
 #268

^ Right. Good point.


average-fast = f(x)
average-fast-sig = f'(x)

average-mid = g(x)
average-mid-sig = g'(x)

average-slow = h(x)
average-slow-sig = h'(x)

sig-1 := if average-mid > average-mid-sig, buy. if average-mid < average-mid-sig, sell.

sig-2 := if average-fast > average-fast-sig, buy. if average-fast < average-fast-sig, sell.

sig-3 := if average-slow < average-slow-sig, sell.

trade-signal := if sig-1 == sig-2 == sig-3 == sell, sell. if sig-1 == sig-2 == buy, buy. o/w, do nothing.


To be clear, the final trades are based on the combined 'trade-signal' condition.

ah OK, so it is not a code, it is kind of a logic you have, and do you daily pull the data and calculate it manually? if yes, then where from and how do you get that data?

The above is just the pseudocode because Lambchop thought it'd be easier to understand. It is not calculated "by hand", if that's what you mean.

Based on the regular exchange data, like the one you can get from sierrachart, tradingview, or bitcoincharts. Nothing proprietary or secret.

Not sure which Bitcoin wallet you should use? Get Electrum!
Electrum is an open-source lightweight client: fast, user friendly, and 100% secure.
Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
Biodom
Legendary
*
Offline Offline

Activity: 3752
Merit: 3869



View Profile
January 28, 2015, 05:35:19 PM
 #269

Guys! Back on topic please!!!  Angry

We're here to discuss black box, underperforming trading algorithms with stupid names, not nematode registration.

"nematode registration"... *snort*

don't you curse nematodes. They are an important genetics model organism (C. elegans), from which much was learned about aging, development, etc... Wink
bucktotal
Full Member
***
Offline Offline

Activity: 232
Merit: 100


View Profile
February 13, 2015, 01:56:31 PM
 #270

my lazy-whale signal flipped up again this am.
oda.krell (OP)
Legendary
*
Offline Offline

Activity: 1470
Merit: 1007



View Profile
February 13, 2015, 02:00:47 PM
 #271

^ Remarkably similar then. Mine is getting close as well, but I decided not to post "predictions of signal changes" anymore... I'll update if and when it flips, that's prediction-y enough Cheesy

Not sure which Bitcoin wallet you should use? Get Electrum!
Electrum is an open-source lightweight client: fast, user friendly, and 100% secure.
Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
bucktotal
Full Member
***
Offline Offline

Activity: 232
Merit: 100


View Profile
February 13, 2015, 02:13:23 PM
 #272

i think last time i was a little ahead of you on the upswing as well. but i think i was a little later on the downswing. my last lazy-whale trade was also ~ -15% or so. doesn't matter. small losing trades and big winning trades is what the lazy-whale strives for imo  Cheesy

oda.krell (OP)
Legendary
*
Offline Offline

Activity: 1470
Merit: 1007



View Profile
February 13, 2015, 04:11:23 PM
 #273

Right, I remember your post from last time now.

Alright, so now I'm actually interested what's going on ... if you don't mind the question (and I sure can't complain if you do, after being pretty mum about my own algorithm initially as well Cheesy), are you using a similar logic like I do for my signal (as in: asymmetric sell condition to account for Bitcoin's "bubbles"), or something entirely different?

Not sure which Bitcoin wallet you should use? Get Electrum!
Electrum is an open-source lightweight client: fast, user friendly, and 100% secure.
Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
bucktotal
Full Member
***
Offline Offline

Activity: 232
Merit: 100


View Profile
February 13, 2015, 08:26:14 PM
 #274

Right, I remember your post from last time now.

Alright, so now I'm actually interested what's going on ... if you don't mind the question (and I sure can't complain if you do, after being pretty mum about my own algorithm initially as well Cheesy), are you using a similar logic like I do for my signal (as in: asymmetric sell condition to account for Bitcoin's "bubbles"), or something entirely different?

my method is fairly simple (similar to a 10/21 crossover) and im happy to share as much about it as you do about yours. i have no asymmetric conditions, just sliding window boxcar smoothing.
inca
Legendary
*
Offline Offline

Activity: 1176
Merit: 1000


View Profile
February 13, 2015, 08:30:54 PM
 #275

Please post both your indicator changes on the forum.
uvwvj
Full Member
***
Offline Offline

Activity: 145
Merit: 100


View Profile
February 13, 2015, 08:53:22 PM
 #276

Right, I remember your post from last time now.

Alright, so now I'm actually interested what's going on ... if you don't mind the question (and I sure can't complain if you do, after being pretty mum about my own algorithm initially as well Cheesy), are you using a similar logic like I do for my signal (as in: asymmetric sell condition to account for Bitcoin's "bubbles"), or something entirely different?

my method is fairly simple (similar to a 10/21 crossover) and im happy to share as much about it as you do about yours. i have no asymmetric conditions, just sliding window boxcar smoothing.



 Wink
ssmc2
Legendary
*
Offline Offline

Activity: 2002
Merit: 1040


View Profile
February 13, 2015, 09:04:53 PM
 #277

Right, I remember your post from last time now.

Alright, so now I'm actually interested what's going on ... if you don't mind the question (and I sure can't complain if you do, after being pretty mum about my own algorithm initially as well Cheesy), are you using a similar logic like I do for my signal (as in: asymmetric sell condition to account for Bitcoin's "bubbles"), or something entirely different?

my method is fairly simple (similar to a 10/21 crossover) and im happy to share as much about it as you do about yours. i have no asymmetric conditions, just sliding window boxcar smoothing.

Like this?

Wandererfromthenorth
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile
February 13, 2015, 09:32:18 PM
Last edit: February 13, 2015, 09:42:36 PM by Wandererfromthenorth
 #278

OP:


I think what you wanted to do was a good idea (profiting as much as possible from bitcoin's price behaviour but integrating trading into the mix but with the least effort (aka fewer trades possible)), but the actual implementation might not be the best one.

First of all it is based on assumptions that should not be taken for granted:

"(1) Bitcoin can experience massive gains in very short time, so by default, your position should be long.

(2) However, if there is a very clear trend reversal to the downside, sell.

(3) If you sold too early (into a downtrend that didn't manifest), don't hesitate to buy back at a small loss if necessary, because: see (1) above."



A trader should not be biased, for all he knows, bitcoin is a bubble that might continue to crash once it actually bursts. So the "favour a long position" strategy might work as long as bitcoin is in "pump mode", until it doesn't (the "dump mode"). A trader should only focus on the chart, it should tell him all he needs to know.

I think you should just forget about algorithms and complicated indicators and just trade with very basic TA tools like triangles and trend lines (on high time frames only, considering you want to minimise effort as a trader) depending on how much effort you want to put in the "trading part" of the investment strategy (if you want to incorporate short selling or not, how many trades do you want do perform every a month/every few months, etc).


Instead of "LazyWhale algorithm", it would just be the "LazyWhale strategy".

An example using 2013-2014:



Most of these is what I actually did in my trading (while shorting on the downside instead of just holding USD) and posted them here (as others have, it's just to say that it's not just hindsight Tongue), playing smaller waves too tho (it depends how "Lazy" you want your "LazyWhale" to be).


If you use complicated indicators and such, your "buy signal" might be a mistake and you might buy at a top. You should instead use simple trade setups like "buy the wedge breakout/sell the wedge breakdown" because that way you know that when you execute your trade the price will move in your direction massively right away. You're able to time the market (and estimate the magnitude of a trade) and avoid getting chopped off by consolidations and noise that might mess with your indicators and algorithms.

PS: you cannot really see the double top in that high time frame but on lower ones it is pretty flagrant.


oda.krell (OP)
Legendary
*
Offline Offline

Activity: 1470
Merit: 1007



View Profile
February 13, 2015, 10:20:15 PM
 #279

OP:


I think what you wanted to do was a good idea (profiting as much as possible from bitcoin's price behaviour but integrating trading into the mix but with the least effort (aka fewer trades possible)), but the actual implementation might not be the best one.

First of all it is based on assumptions that should not be taken for granted:

"(1) Bitcoin can experience massive gains in very short time, so by default, your position should be long.

(2) However, if there is a very clear trend reversal to the downside, sell.

(3) If you sold too early (into a downtrend that didn't manifest), don't hesitate to buy back at a small loss if necessary, because: see (1) above."



A trader should not be biased, for all he knows, bitcoin is a bubble that might continue to crash once it actually bursts. So the "favour a long position" strategy might work as long as bitcoin is in "pump mode", until it doesn't (the "dump mode"). A trader should only focus on the chart, it should tell him all he needs to know.

I think you should just forget about algorithms and complicated indicators and just trade with very basic TA tools like triangles and trend lines (on high time frames only, considering you want to minimise effort as a trader) depending on how much effort you want to put in the "trading part" of the investment strategy (if you want to incorporate short selling or not, how many trades do you want do perform every a month/every few months, etc).


Instead of "LazyWhale algorithm", it would just be the "LazyWhale strategy".

An example using 2013-2014:



Most of these is what I actually did in my trading (while shorting on the downside instead of just holding USD) and posted them here (as others have, it's just to say that it's not just hindsight Tongue), playing smaller waves too tho (it depends how "Lazy" you want your "LazyWhale" to be).


If you use complicated indicators and such, your "buy signal" might be a mistake and you might buy at a top. You should instead use simple trade setups like "buy the wedge breakout/sell the wedge breakdown" because that way you know that when you execute your trade the price will move in your direction massively right away. You're able to time the market (and estimate the magnitude of a trade) and avoid getting chopped off by consolidations and noise that might mess with your indicators and algorithms.

PS: you cannot really see the double top in that high time frame but on lower ones it is pretty flagrant.

Nice trades, if you followed them all Smiley

That said: this is supposed to be an exercise in algorithmic trading, i.e. I'm trying to define a completely automated signal and see how far I can get with it. Never said that's the only way of trading, or even that I am relying on it exclusively.

About the other point, "traders shouldn't be biased" (to the upside, in this case)... I answered that as well in my OP I'd say Cheesy It's actually the premise of this method that it has such a bias, i.e. it only makes sense to even consider using this signal under the assumption that you are an "investor" who believes in Bitcoin's long term potential, but you would also like to have some protection from the (often extreme) drawdown your position can suffer in this market.

Short version: I claim the flaws of this method that you are mentioning aren't flaws under the basic assumptions of it.

However, the objections raised before, that there are too few trades over the entire history to have any real certainty about the backtesting results, or that there was no clear separation between training and testing data, are absolutely valid.

Not sure which Bitcoin wallet you should use? Get Electrum!
Electrum is an open-source lightweight client: fast, user friendly, and 100% secure.
Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
oda.krell (OP)
Legendary
*
Offline Offline

Activity: 1470
Merit: 1007



View Profile
February 13, 2015, 10:24:01 PM
 #280

Please post both your indicator changes on the forum.

Isn't that exactly what we've been doing?  Wink

Bucktotal's signal flipped to 'buy' earlier today. My own signal still suggests the same position as before (USD), for now.

Not sure which Bitcoin wallet you should use? Get Electrum!
Electrum is an open-source lightweight client: fast, user friendly, and 100% secure.
Download the source or executables for Windows/OSX/Linux/Android from, and only from, the official Electrum homepage.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 [14] 15 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!