Mike Fishy and Automation System Programming (Bots)


@mwlang opening TV now to look at the LazyBear hack, thanks. I had “RSI review” on my notepad so your post was well timed.

My bot wasn’t running during the recent drop but it was in semi-automatic mode during Saturday’s move up. It’s now in fully automatic mode and I’m waiting for the next big move to see how resilient Binance’s API is.

As indicated by the screenshot below, the bot handles normal trading periods without any major problems. One fail in the last 150+ trades and possibly a problem with my WISP. The bot is also on a cloud server and that has even fewer problems i.e. no timestamp hacks required etc.

I’ll get the bot to try the trade a few times if it fails as currently it just skips the trade until the CDA receives the next trading signal.

Like @mwlang I’m very grateful for the inspiration you have provided throughout this thread.

1 Like

I think it’s line 15 which prior to edit is:

b1= 2.0*a1 * cos(1.414*180 /bandedge)

Link: https://www.tradingview.com/script/ieFYbVdC-Ehlers-Universal-Oscillator-LazyBear/

@mwlang actually the mod is failing to compile on my TV.

OK now, for some reason the edit was losing a couple of multiplications.

1 Like

@Blynker, looks like you were right…I must’ve inserted a blank line into my version to help me read it better.

First time I’m attempting to publish anything on Trading View:

Hopefully it makes sense and works.


Yes. Ps4 is the way to go now. Especially given the capacity to upgrade the storage PS4 turns into an unstoppable gaming machine. Check the guide https://www.ps4storage.com.

1 Like

You are my people. This whole thread is fascinating. Thank you for sharing your journey and this sick project.


@Mike_Fishy, which do you find a better strategy:

Given a pool of say, $1000 USD allocated to any one CDA

  1. run one trade at a time, investing full amount allocated plus all profits from each trade, relying on power of compounding to grow the total funds.
  2. split the $1000 into, say four equal amounts of $250 and watch for buy signals and buy at $250 a pop until full funds utilized (eventually, theoretically, you’ll have 5 trades at $250 once $1000 grows to $1250, 6 at $1500, and so on…)
1 Like

We put our bot into live trading for about 10 hours today (details to follow in the other thread) and it came out with a tiny profit after 74 trades (37 CDA buy and sell).

Currently BTC dictates most CDA trading so you could simply trade a single CDA, but alts tend to have greater volatility. This can be a good or bad thing depending how well your algorithms are working.

Our bot will only hold one pot for any given CDA so from the @mwlang example it would be $1000 for each CDA rather than up to $250 * 4 for each CDA. We don’t actually allocate a specific pot to any CDA though. It’s simply the total trading pot split over the set maximum of CDA’s for each BUY.

We too have a question for the bot masters (2 * Mike).

Do you have a “kill” switch for your bot and does it help mitigate losses on down days?

We have coded up a kill switch that will sell off all CDA’s if BTC dives. We also have a manual kill that we use to close out all our live trades when switching from live to simulated trading. We don’t want to have to manually sell the CDA’s.


I split it into multiple amounts, but then my bot trades multiples of a single CDA as well as multiple CDA’s.

For example: Lets say a CDA has a trend change and starts going up, you buy a position. If it trends up more than 1%, my bot buys a second position. If it trends up another 1%, it buys a third position. As you buy positions on the way up, the highest position is your stop loss where all positions are sold.
IE: as the highest position hits the stop loss risk threshold, all the lower positions are sold as well.

The strategy works only on longer time frames (less aggressive bot). If you want to go the aggressive bot with single positions on short time frames, then use small amounts across as many CDA’s as you can (of course excluding all the ones that just don’t perform).

So I use lots of small positions and with $1000, I would use 100 x $10 positions across multiple CDA’s at once.

However, there is no perfect strategy, it is mostly about managing risk.

Stay Fishy


Any news here in and progress with coding? Thanks a lot for this man! :):slight_smile:


@Mike_Fishy, Thanks for sharing on how you approach this. I like that strategy of buying on the way up. Might as well keep betting on the winning horse until it’s not winning any more.

Do you martingale on losses? That is double your position size for the next buy after a loss.

The reason I ask is because I think it’s a strategy that can go hand in hand with buying on the way up at the 1% marks. After all, we’re reasonably sure the price action will reverse at some point.


Yes, if the ST/MT/LT are good and you buy a position, but it drops and hits your stop loss, wait for the next ST/MT/LT when it is down and buy another position instead of doing a stop loss.

Market is like an elastic band, it always tries to go back where it was in the short term on average. However, if the second position hits the stop loss, then I generally take the loss and flag the CDA as “Dont Trade” for a week. Frees up funds to play on CDAs which are doing better.

After a while, you build up a list of CDAs that are on the “Dont Ever Trade” list (like BCash) :stuck_out_tongue:

That’s why even in the code which was pasted above, there is the “exclude” list.
If it is not performing and end ups on the “Don’t Trade” list a few times, I look at how it is doing overall and if bad, it gets added to the exclude list. My exclude list is a bit long :slight_smile:

New code I’ve been working on, doesn’t get prices from the price API call, I am using the “Depth” API call instead. So far, it doesn’t seem to make a lot of difference other than getting the volume indicator working. The code is getting ugly though, I really need to re-work it.

I’m looking forward to hearing how 3rd party integrations are going to work in Yen.io
I think as a team, we could build an auto trade tool as an extension for people to use.

Stay Fishy


Thanks for the great insights again! What % profits are you aiming for / making on average with your bot man? Just trying to find a benchmark kind of thing to judge my own trading performance so far! :slight_smile: :slight_smile:

1 Like

Anywhere between 2x and 7x per day.

Many people don’t realise, you can make money on the way down as well as on the way up.
(Going Short vs Going Long)
Plus I have found moving funds from BTC to BNB to ALTs back to BTC can be quite effective.

Stay Fishy


Wow, 2x and 7x per day on entire balance?

Thats like enormous!

1 Like

Yup, that’s how I turned 0.8 BTC to 236 BTC in one year, during the 2018 great bear market where everyone else was crying about not making money. You only have to read through this thread to see what was done.

I always tell people what I do, less than 0.1% of people will actually do something about it, so it’s not like I have much competition :slight_smile:

There is even code in this thread to help people get started.

The biggest piece of advice I could give anyone, you have to be in the game and do it every day, if you are not in the game, you are not learning and won’t achieve. So, be in the game to win and you have to stick with it, even if you are not winning - as that is when you are learning. There is no silver spoon approach, it is like learning to ride a bike, you have to get on and fall off a few times.

I also did a thread on my daily routine which can also be easily adopted to make good trades with only minimal effort and no bot needed.

Stay Fishy


Well, there’s another side of this coin, too. You have not only decades of coding experience, but decades of trading experience as well and there’s a lot to be said for that. Like a seasoned programmer that can cut to the chase and write the smallest, simplest code to get even complex jobs done, I can see that you know what you’re looking at on the trading charts and price action and dialing it down to the bare essentials to make things fly.

I don’t know how long it would’ve taken me to realize that working with uncompressed data, one can still generate moving averages, RSI’s, and so forth that hold water just as much as when generated off the compressed data of a candle stick chart. That, to me, was an eye opener and probably one of the biggest takeaway I got from your shared code. above.

Another example is how I came to implement Ehler’s dominant cycle in order to know what the cycle lengths were whereas you had the much, much simpler solution of measuring iterations between ST and MT crossings to derive the proper settings. And who knows where 4xST for MT and 6xMT for LT came from, other than brute force testing to find the optimal settings there. Even classier, is the 9 bar average vs current value trick to figure out bias on the MA’s.

I would say you have very little competition because you have skills and the chops in this arena to absolutely crush it. Even though you’ve shared much above, there are still missing components – like incorporating volume data into the decision matrix, for example.

That’s just to say, there’s still much to learn and I, for one, hope you keep on sharing and look forward to your next installment. Every day, I’m building; I’m testing; I’m continuing to learn much about modeling price action successfully and automating the trades against those patterns.

Tips for Newbie

Funny you should mention that :smiley:

I have been working on it, its still in “Alpha” stages.

Edit: as for competition, I’m sure hundreds of people read a lot, but don’t ever act on it. To be honest, out of every 1000 people that you talk to, only 1 will actually do something.

Stay Fishy


Yeah thats true. However you refered to using volume data before via depth order book (binance depth api to pull this data?)?

How do you incorporate this? Growimg depth is growing volume?

Just thinking about it , as lots of orders are not known beforehand in the orfderbook plus which of all those lines in the order book to take into account? Thanks in advance.


Now that, I can get 100% behind. Those who take action are those who succeed in life regardless of “luck.”


In my main bot, I get volume from the 24hr stats.

Basically, I pull the 24hr stats on a CDA and calculate the difference from the previous iteration.

The 24hr stats are updated every 10 seconds or so.

For example, Yoyo shows:

    [symbol] => YOYOBNB
    [priceChange] => 0.00019300
    [priceChangePercent] => 15.552
    [weightedAvgPrice] => 0.00136092
    [prevClosePrice] => 0.00123300
    [lastPrice] => 0.00143400
    [lastQty] => 4972.00000000
    [bidPrice] => 0.00142500
    [bidQty] => 4610.00000000
    [askPrice] => 0.00143800
    [askQty] => 1393.00000000
    [openPrice] => 0.00124100
    [highPrice] => 0.00152800
    [lowPrice] => 0.00124100
    [volume] => 4967801.00000000
    [quoteVolume] => 6760.77700300
    [openTime] => 1553633001207
    [closeTime] => 1553719401207
    [firstId] => 692808
    [lastId] => 694260
    [count] => 1453

The Volume is the 24hr volume, but since it is updated every 10 seconds, you take that value and subtract the previous value and you have the volume for 10 seconds.

You may have also noticed today many of the ALTs are up against BNB.

This is a fairly common theme, first BNB drops lower, then BTC has a bit of a run, then just about all the ALTs have a run. This is often followed by the ALTs pulling back at the same time as BTC consolidates and BNB starts gaining again.

Knowing the common patterns can be profitable :slight_smile:

Edit: 15% gain on Yoyo \o/
They did their mainnet launch at exactly the right time for the market to react.

Stay Fishy