k0dejunky / bitBot

bitcoin trading bot
3 stars 1 forks source link

geekerV2

Geeker By k0dejunkyDotCom

CHANGE ALL FLOAT columns in the database to DECIMAL and use 16,8 for the size. This fixes rounding issues with the code.

To donate

1Apzahst2nUq226CyQJUHcHQKvy9nWoPvB
(FEEDS DIRECTLY TO BOT)

What Is GeekerV2?

A cleaned up version of the Crypto Trading Automatron Currently Running k0dejunky.com/bitcoin

Better Instructions:

How to start the bot

Pass the Database Password for Database 'geekerV2' to ./geekerV2.pl
Example: ./geekerV2.pl dbPassword

Database

Database Name: geekerV2 (on localhost)
Type: MySql

Hows that work?

It starts with BITCOIN, sells it for ALT coins like DASH and LTC when their prices (in bitcoins) are LOW.
It determines the LOW by the lowest price of 4 hours of monitoring the prices (note: works best after 4 hours of running)
When it places buy orders at the LOWest price of the timeRange, it also finds the HIGHest price of same timeRange.
It notes this, and IF that BUY is filled, it will IMMEDIATELY place the same amount bought for LOW amount BTC up for sale
for HIGH amount BTC. (ie: Buying LTC @ 0.00063000 BTC and selling it for 0.00064000 BTC)
It will only place the BUY order in the first place, IF the sale of same at high will CLEAR THE COMMISSION charged for
the transaction by the exchange (bittrex charges 0.0025% on all).

Once it BUYs it places for sale on HIGHest price of the timeRange it bought in.
But what if it goes out of range? what if thats TOO high or a fluke or even MISdirection from others?
Good question! Thats why there is a DRAGdown Sell function, after 15 minutes, any sell not sold, will have its PROFIT lowered by 5%.
It figures out the current PROFIT then calcs 5% of that, subtracts it, then funkymathTown to get the new UNIT price,
cancel the original sell order, and places a NEW sell order at the new price. The trick is, it WONT do this if
the NEW PROFIT is too low! So in essence, it buys as low as possible, TRIES to sell it super high, then gradually reduces
it until it pops. Very rarely does anything get stuck high anymore(it was an issue in the beginning of development,
this is the solution)

What about the buys? What if they never pop?
Good Question!
Thats why trimOldBuys(15) exists, just like dragdown but way simpler.
For a buy that doesnt sell in the 15 minutes, it gets CANCELLED (unless its partially filled, then it stays)
Its cancelled and forgotten if it doesnt get a bite.
This works because in 10 seconds, it will see it has enough bitcoin (freed by the cancel) to make a buy and
it will, replacing the previous investment with a more time accurate offer.

This isnt everything, some of it might not even be correct. So far the experiment was profitible if guided.

Database Tables

Important Functions

The ones in the code, those are the important ones. Need those.