i've made a shitty php bot for bitfinex. it buys if price goes up and sells if price goes down. with 3.3x bitfinex margin. checking the price each minute.
wish me luck, will post progress. pic related is the initial bot balance (0.02 bch with leverage)
Would you suggest PHP or Python for such types of programs?
Isaiah Rodriguez
either is fine
Eli Price
>using a weakly typed language for financial transactions you probably encourage your sister to go to rap shows
Jose Rivera
irrelevant. i just googled "bitfinex bot example" and went with the language of the first google entry
Jose Miller
>financial transactions you just use it to access the bitfinex api, you dumb cuck
Sebastian Turner
ok, i had some problems with shorting, but now everything should work fine. i'll keep you posted
Robert Gonzalez
You are even more retarded than I thought after your first post
Thomas Ward
That’s right user, buy hi sell lo
Leo Cook
How do you determine if price will go low or high? If you're buying when price goes high and selling when price goes low... You know what it is.
Justin Miller
>checking the price each minute i'm too fast for buying high selling low. if it's a rally then i ride it, if it inverts then i close and lose 0.5%
Luke Murphy
That's actually genius, it's like a brute force bot. Reminds me of PSAR people who put stop losses at -0.1%.
Leo Scott
>it buys if price goes up and sells if price goes down Truly Veeky Forums incarnate, good job user.
Lucas Wilson
trust me, i'm sure it will work.
i'm still fixing shorts, bitfinex' api documention is awful
Brandon Hill
So when will it be up and running?
Lucas Cook
very soon. longs work well, and closing orders too.
the decisional logic is perfect.
the only problem is that short requests aren't working.
anyway, maximum 30 minutes and it's running
Jonathan Morgan
My experience with my bot has been that the most advantageous times to get in are when shit has flash crashed. I know they say not to catch a falling knife, but it's been working well for me so far. +30% in a month and climbing (even despite all this fucking fork drama)
David Sanchez
What's the decisional logic? Or would you rather keep it a secret?
Michael Allen
no PHP is total garbage. It's the official language of rural India
Lucas Stewart
Node. It's what Python always wanted to be, and much better suited for web.
Cameron Hughes
good idea for an entry, but it's too bothersome to code.
checking previous price and setting a bunch of ifs is way easier
i wrote it in the op. check price each minute and ride the wave or cut losses.
Jeremiah Garcia
>python >weakly typed
Gabriel Jackson
Aren't minutes a bit too slow? Why not follow the buys/sells in the realtime and weight them by volume?
Connor Rodriguez
it's exactly 1 minute, which is good enough since it should avoid the retarded random dips and shit. maybe 30 seconds would be better, i'll check later
Isaac Collins
for example, in the last 5 minutes of testing, the bot bought at 1306 and sold now at 1238
Alexander Carter
Buy high sell low, the official biz bot
Angel Hughes
i ment the opposite, ffs
Jackson Kelly
Please dont tell me you didnt even backtest this "strategy"
Jack Gutierrez
kek
Jayden Bell
>implying
Dylan Peterson
oh, and this is the last 24 hours
Henry Nelson
You releasing this, or do we have to implement it ourselves form your one line description?
Wyatt Hernandez
the way your strategy works is buying for e.g. 10 minutes each minute, so 10 times at an increasing price each time then, if at the 11th minute the price is less than at the 10th minute, you sell all previously bought btc so you sell 9 trades for profit, the 10th is at a loss.
how do you save yourself from trading fees? i don't know how high bitfinex' fees are, but i'd take a guess with 0.25%
i'd imagine that the high buy frequency works perfectly in theory, but the price has not enough time to increase so far that your fees are covered
the same strategy would work almost perfectly during 2017's summer if you took some hours as your base time unit
am i making sense or do you not get what i'm talking about?
Tyler Hill
looks like the short are working, almost done. you can post this "code" into pine editor on tradingview to backtest it: //@version=2 strategy(title = "Poorfag's road to Lamboland", default_qty_type = strategy.percent_of_equity, default_qty_value = 100, initial_capital = 10000, overlay = false)
buySignal = ( close > close[1] ? true : false) sellSignal = ( close < close[1] ? true : false)
if ( time>timestamp(2017, 11, 11, 0, 0)) strategy.entry("simpleBuy", strategy.long, when = (buySignal == true)) strategy.entry("simpleSell", strategy.short, when = (sellSignal == true))
if ( time>timestamp(2017, 11, 11, 0, 0)) strategy.exit("simpleBuy", "simpleBuy", when = (sellSignal == true)) strategy.exit("simpleSell", "simpleSell", when = (buySignal == true)) it's more stupid. i just buy once the price start rising, and sell/short once it starts falling. pyramiding is too hard to code atm
>how do you save yourself from trading fees? usually i don't, but bch goes +-10% in minutes, that's how
Aiden Adams
What site/interface is this?
I like the simple logic. No ai and ml buzzmemes
Hunter Ortiz
I'm not super familiar with Pinecode, what is the "timestamp"?
Kayden Diaz
tradingview
anyway, looks like the bot is running. let's see if i coded it properly
since backtesting only supports 2k trades, it's used to limit the first trade to 11/11. technically it's not needed
Zachary Gonzalez
Ah. So it's pretty much "last candle closed over the previous candle" or "last candle closed below the previous candle". Easiest thing ever, amazing.
Obviously you do some price tracking after that to check for the inversions, right?
Do you think checking against simple uptrend/downtrend would help the bot or only make it unnecessarily harder for it?
I'm a huge fan of your solution, it's simple as hell and easy to implement.
Caleb Perry
you can make it 100x time more efficient but i'm lazy, i just want to get the barebones version running atm
Angel Adams
Can I have the download link? i just lost a fuck ton on bch
Alexander Fisher
Be careful now when people are dumping BCH for the difficulty adjustment
Alexander Wright
the bot can short too, no worries.
i'm moving everything from my rpi to my desktop so i can run it without a hassle, 10 more minutes
Ryan Watson
I want to buy it Can you sell it to me
Logan Clark
If you don't know how to implement it yourself, you probably couldn't get it working. Get some API keys first.
Christian Harris
if it works yes, i'll sell it for pics of sharpies in poopers
for backtesting yes. the php code it 100 times longer
Camden Garcia
So it doesn't work yet? Fuck off
Blake Robinson
rude. there isn't that many algo threads on Veeky Forums so don't hate him for trying.
i'm working on a python script! keep up the good fight user-sama, php and you can do it!
Samuel Bennett
wifi is shit, i'm moving it to another pc. and i need to install php here
Justin Stewart
user I'm sorry Add me on @bendthatdick telegram I know a some Java lel
Sebastian Cruz
>So it doesn't work yet? Fuck off Read the thread, dumbass.
Brody Watson
I just implemented this and backtested it with minute candles I've procured since 2011 starting with $10,000 and it lost every penny. I also tried not starting the strategy until 2015 and it still lost every penny.
Ethan Howard
it only works now on bch because the volatility and volume make it possible to cover the exchenge fees
Matthew Thomas
Can you show your work?
What's a pine editor?
Ian Jackson
Buy/sell price is just market close of current row Calling buy() or sell() twice consecutively is equal to just staying in the current strategy (it checks).
Oh and btw, I changed from comparing closing prices to comparing SMA15, and it actually tripled the starting money on $10,000 to my surprise lol.
Formula for buy/sell: tradeFee = 0.0025 feeCoeff = 1 - tradeFee USD = price * BTC * feeCoeff
startDate was Jan 1, 2016
readRow(row) {
price = row.close;
if (lastRow && row.openTime > startDate) { var buySig = row.SMA15 > lastRow.SMA15, sellSig = row.SMA15 < lastRow.SMA15;
if (buySig) buy(); else if (sellSig) sell(); } lastRow = row; }
Oliver Anderson
it's a an editor for trading view's coding language
oh, and looks like i can't install php on windows
Blake Sanchez
You can, use xamp. If you're running it from a command line, there's gygnus. Or just install vagrant and do it that way. chocolaty would also work if there's any kind of windows package.
Adrian Ward
so a 24 hour backtest? lol sounds pretty reliable. Why dont you run one over lets say a months data, with fees and slippage. Then post your sharpe and your drawdown?
Jackson Rogers
i'll run it on the live data once xampp finishes downloading
Evan Cox
why tho? you could easily test it on historic data without risking any money
Robert Allen
i tested it on the last 2 day on trading view. as i said, this shitty strategy can only work because of the current volume/volatility of bch. so it's now or never my friend
Levi Brooks
You don't need to play with real money to test live. It's called paper trading.
Colton Thomas
oh I see, missed the trading view bit. Assumed you were about to run it live as in real money, real exchange. Good luck though anons, I'm trading the bch/btc volatility myself but with a hedging model
Logan Watson
Uhh guys...
10K to 1.5M in 4 years?
Benjamin Anderson
update: short and longs are working, i've setup everything on windows. now it doesn't close orders... but it should be easy to fix.
almost done famalams
Charles Jackson
Keep up the effort. Sounds rather interesting
Oliver Turner
yeah that looks pretty wrong lol...
Dylan Young
>rap shows >not beneficial to an extroverted personality type I recommend all the rap shows
Brayden Brooks
Fee and spread alone gonna kill your profit
Matthew Hall
right, should be a lot more
William Carter
Did you back-tested the algorithm OP ? Also, where can I get 1min candles data to train algorithms ?
Angel Allen
stay poor pleb
yes, read the thread
almost everything is ready btw, fixed closing positions
Jackson Carter
coding an algo right now to try and exploit your algo thxfam
John Powell
seriously though that comment i replied too was dumb af. go to a rap show and there's about 1000 people trying to fit in and being goofy
Ian Ward
Can't wait til you lose all your money.
Jonathan Fisher
good job, but ...why the fuck would you choose .php? >of all of the hands that you might place you digits into, you place them in the hands of the people who will not hesitate to put your digits into their pockets
Elijah Gray
damn thats my female form/wife
fug
Aaron Cooper
>exploit
more people doing this shit the more it becomes a self-fullfilling profecy. i'll share it for free once it's foolproof
the first btifinex api example i found was in php. too late anyway
Kayden Murphy
it's on!
already made 22 cents including fee
Dominic Richardson
nah you didnt get me bro, 'exploit' as in 'exploit your strategy'. I'm only kidding though, aint got not time for this shit. Good luck with your script though I'll be watching this thread
Grayson Gutierrez
Great. And it only works for BCC? Could you set it up for other currencies on bitfinex?
Joshua Cooper
fair enough bitbro >good fortune to you >but the idea needs to be converted(later) to a language that isn't compromised by a people who are born spies, deceivers, liars, manipulators and thieves at heart. no offense
Elijah Reed
like which one? i can backtest on trading view but i doubt it'll work since the volatility isn't this high
Connor Miller
Litcoin and Monero? I get that volitilty isn't high but you want a bot that can work even when volitilty is relatively low. Right?
Joshua Brown
topkek
Adrian Hernandez
yes, but not with this shitty strategy. if you have a proper strategy for those coins then altering the bot is easy
anyway, since the price went up and i can't affor 0.02 bch (minimum trading amount), i'm moving some eth to the bot's fund.
it will be back up once the transaction is complete and i'll post live updates
Robert Nelson
>being emotionally invested in a programming language instead of just seeing them as a tool >not realizing that the best programming language is the one you're most familiar with
Jackson Nguyen
i just tried.
for reference, i got +15000% on bch in 24 hours.
i get +78% on ltc and +95% on xmr
counting fees and slippage, it doesn't look that profitable on those
Thomas Nguyen
Do you even understand what his criticism is?
have you tried changing the logic in the code to take fees into account? e.g. subtract fees from the sell price and add them to the buy price.
Connor Torres
where did you get the historical data? i've been meaning to write a bot to flip ETH or BCC so that i dont have to put any effort into being a whale i know you can get from e.g. bittrex. com/Api/v2.0/pub/market/GetTicks?marketName=BTC-BCC&tickInterval=oneMin but it only goes back 10 days
Nathaniel Gutierrez
>being a whale becoming a whale, i mean
Ian Hernandez
trading view's pine editor has all the data you want
Zachary Gomez
OP can you pls share your resources I want to try and make one, I know python but I have no idea where to begin with this
Justin Howard
>have you tried changing the logic in the code to take fees into account?
i tried it on trading view, with the taker's fee i got "only" +60% in 1 day. with maker's fee it's +1500%.
i think there is an option to do post only order in the api documentation
Ryder Hughes
thanks, is it downloadable though?
Dominic Young
google [you favourite exchange] [your favourite language] bot and tweak it
doubt it. exchanges usually makes you pay for downloading a lot of old data
Levi Lewis
thats a shame, i'll see what i can do about it then, maybe 10 days of 1-minute interval data is enough hopefully i'll get something working so i can brag about being NTR'd by my own bot on Veeky Forums
Nicholas Turner
>i think there is an option to do post only order in the api documentation Is that even possible? I know kraken determines it based on whoever placed their order later paying more.
Brandon Jones
Will you be sharing this code with us?
Logan Cook
oh, found it. i'm placing order's with post only and close them without
according to tradingview that should be +300% or something in a day
if it works yes, but it's a shitty strategy just for giggles. it's way harder setting up php server on windows than writing the strategy
Nolan Scott
How much are you putting into it to get these numbers? I assume the simulation on tradingview has a limited amount of one currency at the start.