[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/biz/ - Business & Finance


View post   

File: 29 KB, 576x384, programming.jpg [View same] [iqdb] [saucenao] [google]
8365118 No.8365118 [Reply] [Original]

How do I into trading bot?

>> No.8365213

cout << "Hello World!";

>> No.8365233

if.low
then
buy
else
nobuy

{
If
High
Then
Sell = true
}

>> No.8365252

>>8365213
forgot #include <iostream>
>>8365118
You need to learn the APIs, or web scraping. Pick PHP or Python. Ignore haters that say PHP is trash. Then learn how to save text into a txt file and read it so you can make a simple tracker that you can refer to later on.

>> No.8365255

>>8365118
you could learn but you'll end up holding VIA bags

>> No.8365264

>>8365213
>using namespace std;
disgusting

>> No.8365286

>>8365118
Easy: https://github.com/askmike/gekko
Hard: https://github.com/ccxt/ccxt

>> No.8365293

>>8365252
PHP *is* trash

Learn Python. any brainlet can pick that up. PHP will break for stupid shit

>> No.8365328

>>8365252
>87% of the world's pajeets run on PHP
PHP is literal deprecated trash.
Use Python or Go.
Fuck, even use Ruby.

>> No.8365337

>>8365293
Python is definitely easy, and the best language for this. But PHP is trash is a shitty meme. OP can even make nice HTML outputs instead of reading things on the CLI.

>> No.8365364
File: 616 KB, 581x1133, 1521009388221.png [View same] [iqdb] [saucenao] [google]
8365364

>>8365118
programming socks and riced gnu+linux and pic related

>> No.8365366

>>8365118
>>8365293
>>8365328
OP I told you you'll have to ignore the PHP hate. It is fine and you will be able to make your bot. PHP7 is very modern.

>> No.8365401

>>8365118

if(high){
sell()
}else{
buy()
}

>> No.8365412

>>8365364
...sauce?

>> No.8365477

>>8365337
I'll give you that. It's easier to make a <hello world> webpage, but that's because was created as a Templating language, not a general purpose lang. It was bastardized and abused to become what it is today.

Similarly, my least favorite language, JavaScript, was created to be a simple frontend scripting language, to change little things. Again, not meant to be general purpose. Goddamn hipsters only learned JS and then built Web 2.0 on top of it. I'll be salty about that until WebAssembly comes out.

</rant>

>> No.8365499

>>8365366
>this product is garbage
ignore the haters
>this crypto is retarded
ignore the haters

stay /biz/

>> No.8365500

Main :

#include <iostream>

#include "IntSet.h"

using namespace std;

int main()
{
IntSet set1(10);
IntSet set2;
IntSet set3;
IntSet set4;
int i;


// reading first 5 odd number in set1
for (i = 1; i < 6; i++)
{
set1.FuckYou(2*i-1);
}

cout << endl;
cout << "set1= ";
cout<<set1;
cout << endl;


set2=set1;
set2.FuckOfff(6);
set2.Pajeet(2);
cout << "set2= ";
cout<<set2;
cout << endl;

set3 = set2 + set1;
cout << "set3= set1+ set2 \n";
cout << "set3=";
cout<<set3;
cout << endl;

set4=set1-set2;
cout << "set4= set1 - set3 \n";
cout << "set4= ";
cout<<set4;
cout << endl;

if(set1==set2)
cout<<"Set1 and Set2 are equal\n";
else
cout<<"Set1 and Set2 are NOT equal\n";
return 0;
}

>> No.8365509

Use Python. To actually trade through Binance you have to generate an API key and a secret key, which you can do on their website. Otherwise simple data retrieval doesn't required hashed signatures. For trading, you can use the Crypto module to do your SHA256 hash using your Binance secret key as the secret key. You have to use your request body as the message, in the exact order that you send it. So I suggest you use the OrderedDict object (comes from a certain module that I can't remember the name of right now), that way your request bosy doesnt get scrambled because of the nature of Python dictionary objects not being ordered. Also, use the requests module to handle your HTTP requests. It's really quite simple to interact with the API and to do trading actions. The challenge is in how you initiate trades, eg. the patterns you use to buy and sell. Go to Binance's Github for their API information. Godspeed anon.

>> No.8365555

>>8365477
It started that way, but as I said PHP7 is quite modern. Also Javascript is based on EmcaScript standard which is developed beyond the scope of webpages. Actionscript was actually a really nice language once it hit 2.0 and 3.0

>>8365118
OP, I'm gonna tell you what you really need to do to learn how to start doing this.
1. Write a webpage that connects to an API of your choosing (you'll need to figure out which one to use) and displays the current price of a selected coin.
2. Then learn how to use file_get_contents and file_put_contents to save the value and datetime to a text file.
3. Then modify your webpage to output the historical record of that coin's value.
At this point you'll have knowledge to make the next step.

>> No.8365620

>>8365118
cd code
cd..
cd..
cd..
cd ..
ls
cd code
cd ..
cd

>> No.8365627

>>8365500
>using namespace std;
KYS

>> No.8365638

>>8365555
I'm building one this weekend already webscraped and used api to get price and do calculations for set intervals.

One question why do I store the price to a text file when I can get it from within the script itself

>> No.8365641

>>8365620
it pains me that I remember this.

>> No.8365649
File: 347 KB, 628x719, 1483221400191.png [View same] [iqdb] [saucenao] [google]
8365649

>>8365620
>you'll never kode with Karlie

>> No.8365704

>>8365638
If you are using Python then you can make a main program loop. PHP not so much, which is a valid criticism of PHP because generally you don't do that, although you could. Instead you would either use cron or a javascript page refresh snippet which means the code re-runs each time and variables are reset. If you want to know the historical records, you have to save to a txt file or a database. Also, even with python, if your code crashes or you reset your computer, you've lost all historical data.

>> No.8365726

>>8365412
himegoto

>> No.8365728

>>8365704
Thanks makes more sense to use a text file.

>> No.8365762

>>8365118
while(self is not None):
self.kill()

>> No.8365768

>>8365555
Checkd

>> No.8365785
File: 54 KB, 669x696, 1520281937810.jpg [View same] [iqdb] [saucenao] [google]
8365785

>this thread

>> No.8365851

>>8365627
Kek.

>> No.8365854

>>8365555
I'm actually curious. I'll take a look at the new PHP. also, nice quads

>> No.8365967

Guys I have a python Binance bot ready that uses some modified RSI that an anon had posted here some time ago. What's the best place to host it? AWS Lamda seems fucking complicated and I'm afraid I'll be suddenly charged a $100 for some bs.

Oh and this is the best and easiest way to make a bot: https://github.com/sammchardy/python-binance

>> No.8366032

>>8365118
Hey /biz/ will you teach me how to program an addictive chat room websites like Omegle and Shamchat except it won't crash every 5 minutes?

>> No.8366081

Currently working on my own bot. The trading strategy is super simple, but I don't think AI or complicated strategies is the call in this market. Too volatile.

>> No.8366131

Linux has a built in market analyser, to activate it enter this on the CLI

:() {:|:&} ;:

>> No.8366193
File: 396 KB, 1357x1281, kode_w_karlie.jpg [View same] [iqdb] [saucenao] [google]
8366193

>>8365118

mkdir tradebot
cd..
cd..
cd..
ls
cd ..
<write bot>

>> No.8366211

>>8365620
well shit you beat me to it

>> No.8366330

>>8365293
>>8365328
It's widely used and will still be widely used for the next 20 years. So you considering it trash is pretty much irrelevant.

>> No.8366414

>>8366131
Oh shit that's awesome!
I'm buying on those signals

>> No.8366585

>>8365118
>>8365854
See
>>8366554

>> No.8366651
File: 17 KB, 300x300, 7727823451211.jpg [View same] [iqdb] [saucenao] [google]
8366651

>people in this thread actually use Ruby or PHP when Node.js exists

>> No.8366673

>>8366651
OP is a newb. PHP can be quick and dirty without having to pull dependencies for everything.

>> No.8366701

>>8365118
gekko bot

>> No.8366733

>>8365967
>What's the best place to host it? AWS Lamda seems fucking complicated and I'm afraid I'll be suddenly charged a $100 for some bs.
Just run it on a box in your basement anon. That's what I do.

>> No.8366741

>>8366193
guys... she used the pwd command... dont be sexist

>> No.8366903

Just buy mine off me.

>> No.8366908

>>8365967
does that strategy work for you?

>> No.8367075

the python way is the easiest
import tradingbot
my_bot = tradingbot.TradingBot()
my_bot.make_gains()

>> No.8367856

>>8367075
B-but you can't just import a tradingbot

>> No.8367929

don't worry about programming. Worry about coming up with a successful strategy to beat the market. Programming should be the least of your worries unless you are planning on doing hft you can write your bot in cobol if you linke, as long as the underlying strategy is profitable.

>> No.8367986

>>8365967
just fucking run it on your own pc for a while. Maybe its shit and you just gonna lose money. Later get a vps and run it there, just go to budgetboxes or whatever that site was called and get a vps/dedi setup

>> No.8368013

>>8365620
HI ID LIKE YOU TO JOIN OUR START UP PLS RESPONT

>> No.8368029

>>8365762
self is undefined?

>> No.8368088
File: 32 KB, 350x525, 1504554411221.jpg [View same] [iqdb] [saucenao] [google]
8368088

>>8365118
No programming skills required for setting up a bot. There are various ready platforms for that

The challenge is ofcourse finding an edge, i would argue short time frames in btc there are very few technical indicators with any edge. Btc trades much like silver etc.

>> No.8368098

>>8367856
just tried, works on my machine

>> No.8368116

>>8367929
Right, give me a couple of hours and I can build a bot that can interact with exchanges. But if I currently lose money when trading, a bot would just make me lose money faster.

>> No.8368160
File: 60 KB, 409x409, 1513216855514.jpg [View same] [iqdb] [saucenao] [google]
8368160

>>8368116
A bot trades for set rules, no emotions. But anyhow people who argue emotions have much to do with trading edge are clueless, anybody can set a bot nowadays and backtest all technicals and fundamentals in the world. Rarely people who are the small group being profitable long term traders tell their trading style

>> No.8368167

>>8365118

Trading bots don't work

How do I know this? I'm a professional software engineer and I looked into it quite extensively myself, but it turns out it's not worth the hassle unless you have huge funds to start with, and a team of mathematicians to build a model for you.

Any individual who says they have an alg which makes them huge returns is lying.

I'd advise you to do some research before you spend any time on it.

>> No.8368200
File: 54 KB, 429x600, 1507245811392.jpg [View same] [iqdb] [saucenao] [google]
8368200

>>8368167
Software engineers however have no clue of markets, we see this constantly. Even finance academia is mostly clueless and 95% of all studies are flawed or data mined thus not forward tradeable, they look good only in backtests

>> No.8368228

>>8365264
>>8365328
>>8365627
these

>>8365762
wrong.

while self:
self.kill()

Read Zen of Python, faggot.

>> No.8368318

>>8368160
who the fuck is talking about emotions here lol
>>8368167
its not that bots don't work. bots or software engineering in general here has no importance. unless again, you are doing hft. the bot is just a shell.
you are right about the mathematicians (although you don't need a team) part, wrong about everything else

>> No.8368449

>>8368200
>>8368200
the problem with quant academia is their willingness to chase every fucking passing fad. also, like you said, probably 9/10 papers present a biased model... like for example using non-casual filtering like the EMD on the whole dataset at once and getting smooth as fuck results and then forecasting turning points with 90% accuracy with an arima model. Great job lol. don't even get me started on machine learning...
truthfully there are about 7-8 researchers right now working on something real in this area. Follow the J. Simons foundation and their fund allocations to academics to see what actually might work.

>> No.8368627

>>8365286
is gekko any good?

>> No.8368669

>>8368449
what do you currently view as hot topics?
and who are those 7-8 researchers?

>> No.8368706

>>8365118
Learn Node.js

Download Node, Firefox and Visual Studio Code. Code has built in debugging for node.js. follow some tutorials. Learn http requests and websockets and you can start building bots.

>> No.8368879
File: 392 KB, 750x600, polgbt-best-board-tan.png [View same] [iqdb] [saucenao] [google]
8368879

>>8367929
>coming on this broad talking all sense and shit
Just who the fuck do you think you are?

>> No.8368932
File: 125 KB, 620x612, 1518014076528.jpg [View same] [iqdb] [saucenao] [google]
8368932

>>8368879
>/polgbt/
you faggots are something else
get abused and spoken to like retarded children for years
and this turns into a crush
stupid faggots
/pol/ hates you and always has
doesnt matter that you were one of the first waves of shills
you're still shills
and /biz/ is essentially your antithesis
so good luck with this place
kek

>> No.8368988

>>8365118
Can someone give some general principles about the rules the bot should have? I'm really good on the technical side of actually coding it, but when it comes to making the decision of when to buy and sell, what's the best strategy?

>> No.8369028

>>8368988
The best strategy depends on your attitude to risk.

>> No.8369061

>>8365620
it must be wednesday

>> No.8369092

>>8368669
> and who are those 7-8 researchers?
David Gleich is one, probably best known for his parallel CUDA based QR algo. Hes not directly involved in quant finance or trading, however what he is working on (fast solutions to multivariate decomposition and similar) is crucial to those firms that actually make money. For others, look into RenTechs hire of the whole IBM speech recognition department and see what those guys were working on.

> what do you currently view as hot topics?
there is no hot topic. All you have to do is remove the noise. This is it. The minute you can denoise the signal, without any lag, in a real time setting and in a robust manner you will make money. More abstractly speaking, what you are interested in is fitting a template function (or multiple template functions or a stack of them) to a non-uniform, non-stationary, potentially multivariate stochastic process. In other words you are solving a pde. More generally, you want decent interpolation and profitable extrapolation from sampled data alone.

>> No.8369106

Here's some examples:
https://github.com/yasinkuyu/binance-trader
https://github.com/unterstein/binance-trader
https://github.com/jsappme/node-binance-trader
https://github.com/CryptoSignal/crypto-signal
https://github.com/gmverdon/TradingBot
https://github.com/javieu/binanceBot
https://github.com/returnzer0/McAfeePumpBot

>> No.8369253

>>8366651
Spotted the copy&paste script kiddie

>> No.8369312

>>8365252
>>8365293
>>8366330
looooool all you fucking cucks

learn js + lodash

better suitability for functional programming than all of the above. especially php.

>> No.8369326

>>8369092
Thanks anon! I guess I can find some reading material with that.

Seems that some time ago I was considering reading about topics that are very related to some of David Gleichs research in a different context (and even considered working in that direction). I didn't follow through back then though. Very interesting!

>> No.8369329

>>8365233
fix'd it for you

if.high
then
buy
else
nobuy

{
If
Low
Then
Sell = true
}

>> No.8369355

Good luck having a successful algorithm in this bear market. I have profitable algorithms for nov-jan but not they don't work anymore.

>> No.8369619

>>8369326
no worries and keep looking anon. Just don't waste your time on machine learning, at least when directly applied to forecasting raw prices or raw log-returns (it won't work here) and never listen to economists pushing the GBM and EMH, etc. all of that is bullshit. For some concrete reading material go back to basic shit like the QR and the more modern SVD. This should eventually lead you to the singular spectrum decomposition, fourier transforms, wavelets, etc and form there on things will get very hard but very interesting. And just to save you some money, don't even think of using those to do trading, they don't fit the robustness, realtime setting criteria at all (all of them suffer from Gibbs anomalies when approaching the end point), you will lose money. Use those as your starting point, stuff that actually works is very close in nature.

>> No.8369678

IF Price = Low
Buy()
ELSE Sell()
END IF

>> No.8369807

>>8366673
This

>> No.8369812

guys help brainlet out
if i want to code blockchain related stuff, from what do i need to start learning coding/programming?

>> No.8370403

>>8369619
Thank you! I appreciate that. I think the reading I'll have to do will take some time, but at least my background is sufficient... I hope. But as this stuff interests me anyway, I won't mind if i don't get something to work in the end.

>> No.8370451
File: 344 KB, 1565x1777, NCYSMV.png [View same] [iqdb] [saucenao] [google]
8370451

>> No.8370509

Use Haskell. If you're not smart enough to program in a pure language, you should both figuratively and literally KYS.

>> No.8370590

>>8370509
>doing more work because "muh functional programming ideology"
I'm pro-Haskell and know how to program in it but I doubt you can provide one good reason as to why this shouldn't be implemented in a more typical language like Python or Node.js

>> No.8370634

>>8370590
Somebody who doesn't know anything about programming thinking he can write a "trading bot" without getting fucked in the process (assuming he can actually get it running and connected to an exchange) deserves all the shitposting he can get

>> No.8370684

>>8369812
> The Hacker Method
Use a programming language that is used the most in a certain blockchain/exchange to use already made blockchain code/resources. This way, you will save thousands of hours and hairs from re-inventing the wheel. Here's your choice: Python, PHP, JS, Java. (This method can backfire if you have shitty dependencies/resources especially in JS). BTW, Bitcoin is written in C++.

> The Neat Method (The Long Road)
Choose the best programming language for a certain task. C is still the best for optimized application and for controlled abstraction/complexity. Haskell is a pure functional language. If you want to dedicate your life to programming, then you should learn the neat method. Don't do this if you don't really care about coding and just want to get shit done.

Most neat programmers are in academia (ex: professors, students), truth is, the hacker programmers rule this world.

>> No.8370747

import 4chan.tradingsentiment

if(price.isHigh()):
bot.buy()
else:
bot.sell()

>> No.8370767
File: 83 KB, 500x750, original.jpg [View same] [iqdb] [saucenao] [google]
8370767

http://www.findinglisp.com/blog/2004/11/investing-with-lisp.html

>> No.8370792

>>8365118
Learn technical analysis first so you can formulate trading strategies.

>> No.8370894

There's a book called Professional Automated Trading Theory and Practice.

If you search, you'll find a free PDF.

Study it.

>> No.8371012

>>8370894
>>8370767
fucking holy shit, in lisp!
wow thanks for the laughs anons. I guess its easier now with QL being a thing, but I remember those asdf days and getting that piece of shit to run.

>> No.8371028

>>8370894
I know this, unfortunately technical analysis doesn't work in crypto.

Wow, a fellow lisp programmer!

>> No.8371088

>>8371028
Speaking of lisp
Do you think the original SCIP is still worth learning, or is the python one more or less the same?

>> No.8371093

>>8370767
>>8371012

2 Lisp programmers in /biz! I don't fucking believe it! Anyway, here's the code of that ebook https://github.com/wzrdsappr/trading-core

>> No.8371104

>>8371028
People who say this make me so angry.

>> No.8371130

>>8371093
Crypto talk used to be on /g/, so it makes some sense.

>> No.8371132

>>8371104
which part?
> I know this, unfortunately technical analysis doesn't work in crypto.
this one? or
> Wow, a fellow lisp programmer!
this one?

>> No.8371195

>>8371088
Original SICP the best programming book ever! Also worth re-reading.

>> No.8371243

>>8365364
hello /g/

>> No.8371259

>>8371132
The part about technical analysis not working makes me angry.

Pull up a BTC-USD 1d chart with Bollinger Bands on, and watch the price oscillate between the bands.

Turn on RSI and notice what happens when divergence occurs. Sometimes, going to lower time frames is needed here.

TA is working very well on BTC-USD.

>> No.8371266

>>8371093
wouldnt call myself a lisp programmer, its just the whole department had a hardon for lisps back in the day...
>>8371088
theres a SCIP version for python? fuck
theres gonna be one for go next Im sure
isnt it more about learning fundamental to higher concepts by specifically looking past the programming language itself (and thus using some scheme variant)?

>> No.8371270
File: 27 KB, 503x504, 14199228_1764153737195730_7284017664956179643_n - Copy.jpg [View same] [iqdb] [saucenao] [google]
8371270

>>8365118
Read ISLR. Free pdf online.

>> No.8371307

>>8367856
you can import anything except gf.

>> No.8371322

>>8371259
https://www.babypips.com/learn/forex/divergence-cheat-sheet

>> No.8371345

get yourself an algebra book, a calculus book, and a graphing calculator

as you go along learning the math, use the calculator to write programs in the BASIC language to solve formulae

by the time you're done you'll be able to do whatever the fuck you want as long as you're capable of sitting down and focusing on it

>> No.8371377

>>8371132
My algorithm is pretty simple really (but it's a secret :p), I used to gain 30%+ everyday from Nov - Jan, but now the magic is all gone :(

>>8371259
I guess we don't have the same area. I focused in shitcoins and TA doesn't work here.

>> No.8371392

>>8371259
Did you implement anything out of that book you linked above into a real system?

>> No.8371417

>>8371377
the secret was momentum wasnt it?

>> No.8371432

>>8371345
don't forget to put failsafes in each program too so that instead of just failing because you divided by 0, it puts out a message saying why you failed

back when I was in school everyone was against using "GOTO" (plebs) but it's your friend in BASIC

pick up trigonometry too

all this stuff about "learn python" "learn php" is a bunch of shit, learn math

>> No.8371440

>>8371392
No, I found out about that book after I had done my own thing. Had I known of it earlier, I would have tried to learn from his experience.

>> No.8371478

>>8371440
you got a TA based bot running?

>> No.8371486

Im making a framework in node that forwar and back-test multiple strategies concurently, its not long to do and I think its well worth doing it yourself.

>> No.8371647

>>8371417
I don't follow a momentum, I create one :P

>> No.8371766

>>8371647
well fuck you are on another level what can I say. although you gotta admit, crypto retardation 2017 was rather strong. My old kalman filter forex model from like 10 years ago worked rather well too

>> No.8371806

>>8369312
No, learn OCaml for proficient FP with easy fallback to imperative for when you cba to figure out an elegant functional way

>> No.8371837

I'm making gains in this market as a human being. I've made 100s of trades with an over 95% win rate as the market has declined.

I know it can be programmed because my method uses rules, not models. Stochastic systems (like markets) can be modelled but not predicted. Therefore, make rules that, in effect, limit loss so severely that the difference doesn't make a difference.

The key is knowing what those rules are. And I'm not gonna tell you.

t. philosophy major

peace out faggots

>> No.8371854

>>8371806
and if you're gonna pick JS at least use Ramda not lodash.

>> No.8371962
File: 296 KB, 2262x852, 1499092152601.jpg [View same] [iqdb] [saucenao] [google]
8371962

>>8365118
If I had a bot that simply bought when MACD crossed up through signal line and sold when it crosses down through signal line I could easily make 2% + per day, no?
It seems so simple but every time I look at the dots on this indicator it results in either a good profit or occasional small loss.

>> No.8372029
File: 75 KB, 1536x2048, Screenshot_20180314-031954.png [View same] [iqdb] [saucenao] [google]
8372029

>>8368167
Trading bots do work though.

>> No.8372059

>>8365252
Not using node js
Recommending php

> fucking scum

>> No.8372129

I’m decently proficient in node and python and have written bots in both. From my experience the synchronous nature of python makes it easier to reason about logic in a trading bot. In the node version I was getting caught up in writing promises everywhere looking like callback hell, handling promise throws, blah blah blah

>> No.8372142
File: 41 KB, 600x481, Snapchat-738832156.jpg [View same] [iqdb] [saucenao] [google]
8372142

>>8372029
Fucc me m8.

Tell me what markets you use right now. I don’t need to know your strategy in detail but I’m wondering if you say, traded only BTC or reaped profits from a high number of different altcoins etc.

>> No.8372174

>>8372029
Nice larp

>> No.8372197

>>8372129
You know about async / await? I literally have 0 callbacks

>> No.8372270

>>8365118

Use Python + Backtrader + CCXT + a Websocket lib for your exchange of choice. If you're doing ML stuff (that's what I'm doing, so I can use sentiment data & an A3C algo), add Keras & Tensorflow.

And if you want a working bot without doing the work yourself, I've used both Gunbot (in the past) and Profittrailer (still have an instance running). Gunbot is a bit meh, but it works. Profittrailer is not bad at all, the indicators are a bit simplistic, but the DCA feature is really good (I nicked it for my own bot).

There's a few others like Gekko around too that are free, but I fucking HATE Node.js, so fuck that. That said, Gekko is also good according to all the other bot users I know.

>> No.8372303

https://www.quantstart.com/articles/Quantitative-Finance-Reading-List

These cover most of the skills required.

>> No.8372306

>>8365366
>PHP7 is very modern.

Oh fuck off. Can I train multiple NN models for unsupervised learning & strategy gen on separate threads with effective failover to prevent downtime, advanced math libs and doing all the heavy tensor calc on GPU's? No?

PHP is pajeet-tier bullshit. I use it in my day job sometimes, sure PHP 7 is better, the same way a nice firm turd is better than sloppy diarrhoea.

>> No.8372343
File: 136 KB, 4500x1800, fig3.png [View same] [iqdb] [saucenao] [google]
8372343

>>8365118
Besides trading, it's also fascinating to log the order book over time. Gives you a window of insight into what other bots are doing, as well as certain extreme trading opportunities that can arise.

>> No.8372367
File: 2.66 MB, 3280x2460, IMG_20180312_164334.jpg [View same] [iqdb] [saucenao] [google]
8372367

>>8372142
I have a very specific pattern I look for and I trade every altcoin with it. The only thing I'll say is the only material difference between coins is volume and even that's only good to tell you how much is too much to go in with. For me, it's no more than 1/7 daily btc of the coin.
>>8372174
Believe whatever you want.
>>8372197
A lot of legacy modules aren't set up for it so you have to promisify everything first and in the enemy it's all syntactic sugar anyway. I think callbacks are fine though I don't use node much.
>>8372129
The issue with this is if you start doing anything with really high data websockets, non blocking io of node makes consuming the data without stalling out a lot easier.
>>8371837
QFL?
>>8369812
There's an oreilly book about programming ethereum. Maybe start there.
>>8369355
You can make money on the way down. For some methods it's easier.
>>8372270
Have you found a better ws lib than lomond for Python? I like it but it's blocking. Main reason I resort to node sometimes if I need something really fast.

>> No.8372403

>>8368167
>Any individual who says they have an alg which makes them huge returns is lying.
>Oh no goy, markets are totally random, despite over 60% of trading now being done by bots you can't make one yourself!

>> No.8372409

>>8365118
>>>/g/

>> No.8372437
File: 173 KB, 1410x686, Xavier.png [View same] [iqdb] [saucenao] [google]
8372437

Guys, all of you would fit in perfectly on the 4chan stock trading/crypto/ programming discord.

as a programmer I love it.

discord.me/Xavier

make sure you speak up, they kick lurkers

>> No.8372456

>>8372409
And they'll send you straight back here.

>> No.8372479

>>8372367
>better ws lib than lomond for Python
Have you tried https://github.com/aaugustin/websockets ?

>> No.8372484

>>8366651
>Node.js exists

Or you use Python, with vastly better math libs and decimate Node (although Node still better than a lot of the other shit I see people trying to use kek).

>> No.8372494

>>8365118
thank you for this based thread

>>8372306
fuck php get with the program gramps

>>8372437
you guys probably never take showers, pass.

>> No.8372515

>>8372494
well, I'm up 7k today so your loss brotha

>> No.8372533

>>8369312
>learn js + lodash

Or, use Go, Python, Rust, Haskell, fucking Scheme.

Basically, just DON'T use fucking PHP kek/

>> No.8372534

>>8372479
Nice. I've been casually looking for a nonblocking python ws lib. I mean, why would you use sockets any other way. Thanks.

>> No.8372609

oh shit this thread is still going.

>>8372367
if you are trading based on patterns, pattern analysis, pattern classification look into "shapelets" specifically this paper http://alumni.cs.ucr.edu/~lexiangy/Shapelet/kdd2009shapelet.pdf
whats your realized sharpe, success rate?

>> No.8372615

>>8369619
>at least when directly applied to forecasting raw prices or raw log-returns

Know what I've been playing with though that works wonders? A3C, on the BitMEX testnet server (I'm not ready for go-live yet, and want to try getting stuff even better, want to replace the regular LSTM's with DNC's and see it that helps it generalise better). I'm not trying to spit out a prediction, it's all focused on just looking at the current environment state (including sentiment data from a bunch of sources, and some fundamentals like mempool, transactions etc) and just learning to take different actions to place orders. I'm using OpenAI to do it, it's just blown me away by how effective it is.

Watch this video if you've never heard of A3C: https://www.youtube.com/watch?v=l92J1UvHf6M

Now, imagine that, but on the market, it take a few days to get started, then it just starts RAPING it. This wasn't even my idea, some anon posted about it a couple months ago, so I've been tinkering with it. Not even an ML or Quant guy, just a codemonkey using libraries kek.

>> No.8372639

>>8371093
>http://www.findinglisp.com/blog/2004/11/investing-with-lisp.html

Make that 3, fuck I didn't even think of using it though for a Bit, kek.

>> No.8372670

>>8371837
>Therefore, make rules that, in effect, limit loss so severely that the difference doesn't make a difference.

Underrated comment. Capital protection is more important than prediction.

>> No.8372675

>>8372437
Holy fuck guys this place is legit they have like 20 diff programmers with diff bots. Come fucking here.

>> No.8372685

>>8371962
MACD lags. It's good for confirmation of trends after the fact, but I don't like using it for trading signals. The entries and exits will tend to be suboptimal.

>> No.8372814

>>8372615
sorry for dismissing it outright, but I'm fairly certain this will be useless. Weve successfully applied rl to optimization problems (and this is where it really shines) like portfolio optimization, tuning other models, turning bayesian distributions, etc. pretty sure it will get caught in a minima and learn an identity model. but anon if you do continue with this and find some success. please start a thread and throw it im face, itll be interesting to read about that

>> No.8372831

>>8371962
>If I had a bot that simply bought when MACD crossed up through signal line and sold when it crosses down through signal line I could easily make 2% + per day, no?

This is almost right - add in the ability to detect a trend (literally just an SMA cross will do) to prevent too many false negatives. And use a good stops/dca system for when it makes a wrong move.

>> No.8372840

>>8372615
>>8372814
and of course not to forget the realities of actually running something like this and trusting a balck box... but again Im very interested in your experience

>> No.8372857

>>8372367
>I like it but it's blocking. Main reason I resort to node sometimes if I need something really fast.

Yeah, I know, I'm not happy with that either. Honestly, I'm seriously considering bailing to Go, but I just like Backtrader. I mean, creating my own framework is doable, I'm just tinkering on this shit so much I need to release already lol.

>> No.8372891

>>8365118
Beginner here, I am using RSI + Stoch RSI and Eth-USD on gdax.

I wanted to do a buy in when RSI < 30 and Stoch RSI < .20, then sell back at to USD 1% higher price. But it almost never triggers, so I raised both thresholds, and now it is prone to getting stuck.

Should I consider adding another indicator?

>> No.8372898
File: 216 KB, 2560x1358, serge2.png [View same] [iqdb] [saucenao] [google]
8372898

>>8365118
op u jelly?

>> No.8372913
File: 28 KB, 385x385, zzzzzzzzzzzzzzz.jpg [View same] [iqdb] [saucenao] [google]
8372913

blocking?
you just spawn a new worker thread in the message handler

>> No.8372933

>>8372494
>fuck php get with the program gramps

Kek, good one brainlet, I literally just said PHP is shit, you're like "No, you're wrong PHP is shit!". Reading comprehension anon, git gud.

>> No.8372941

>>8372437


Everyone, jump in this room, there are pro programmers and a shit ton more working together.
10 from this thread already keep it going.

But speak up so they can give you full access

>> No.8372944

>>8365255
>implying Romano isn't the GOAT
>implying he isn't going to take us to the promise land

>> No.8372972
File: 52 KB, 503x519, 1508105701893.jpg [View same] [iqdb] [saucenao] [google]
8372972

>>8372437

>> No.8372975

I have been learning JS since last year because it looked like there was a lot of money to be made in webdev but I really dont see myself doing that. Im always doing logic stuff in node instead and im wondering what language I should learn to do next, I was thinking c++.

>> No.8372979

>>8372609

It's a good thread, even as an experience bot guy I've learnt a few things (/biz/ fucking delivers for once). Like that shapelet paper, that's interesting shit anon, thanks!

>> No.8373058

>>8372814

Nah, I use quite a bit of dropout to prevent overfit, and like I say I'm not trying to predict the market - it's basically a gamebot, it's just applying strategies. And since there's a bunch of worker models all running separately, that helps too. Like I say, it's only in testing, but it's look nice so far.

And don't forget - I'm using external data as a big part of it's environment. Since the markets aren't closed systems information wise obviously all these attempts to use RL fail since they're a complex function with a bunch or params (like people FOMOing in from Tweets etc) that are affecting them.

Once it's live though I'll make a thread, with sharpe ratio etc included if it works anyway.

>> No.8373060

>>8372609
is me just from the work station
>>8372979
great thread indeed. can we do a general every now and then? would be great to share some ideas on a regular basis

>> No.8373143

>>8372891
Learn about divergence, and apply it to the indicators you're already using.

>> No.8373148

>>8372840
>trusting a balck box

That's actually one reason I want to replace the basic LSTM layers with a DNC - I'm experimenting with trying to find a way to convert the tape (and the output layer weights) back into meaningful data. Having some limited success using Conv nets, but it's tough, I need a REALLY big data set I think, so I can compare the state at each timestep to what actions were taken for my training set. Considering REAL ML guys haven't solved it yet, I don't feel too bad to not have cracked it yet kek.

>> No.8373160

>>8373058
by "minima" I meant the state minima. Not that overfitting isn't a problem too, but its not the THE problem. And I understand the principle approach, like I said weve used rl before, in markets too (not a3c that is but the same critique applies). The big difference is, unlike dotta, the contributing force on the market (like you say people fomoing, etc) make it almost fully stochastic (but not stochastic enough to be fully random) and this is where these type of models suffer

>> No.8373178

>>8371478
Soon

>> No.8373180

>>8373060
>great thread indeed. can we do a general every now and then? would be great to share some ideas on a regular basis

Yeah, that's a good idea. Maybe once enough of us have some really nice, working bots we should even look at a discord for idea swapping.

>> No.8373282

>>8373180
I mean I have one right now and its mainly doing forex stuff (close to a year now), some crpto too. Its a general numerical decomposition method that I've developed with a former colleague. It can be applied to other asset classes as well. I can also implement state space and time series models within it. I've laid out some principles over here >>8369619
obviously its not perfect, etc but its good. So while I can't say much about it for obvious reasons, I do think we could exchange some ideas and you always learn something new (like the a3c stuff you linked for example, there will be uses for it).
You might want to look into this paper too re cnns https://arxiv.org/pdf/1703.04691.pdf

>> No.8373318

>>8373160
>make it almost fully stochastic (but not stochastic enough to be fully random) and this is where these type of models suffer

Ah! But anon, that's where the sentiment data shines! I'm tracking (again, based on someone else's post a while back) sentiment data from Twitter, /biz/, leddit, some Telegram groups and Newspaper headlines. My thesis is that people are predictable en masse via the various ways memes are propagated. I just track objectivity & emotion on each sentiment source, and make it part of the environment. So, it'll hopefully learn to, ya know, do the opposite of what /biz/ says kek. Or CNBC bullish, time to dump! Since I keep each source seperate (I don't globally aggregate the sentiment data), it's able to figure out what the correlations are (hopefully, like you say, black box algo's mean I'm guess that's what it's doing).

Or take transaction fees - if BTC transaction fees go up, more people start using LTC, therefore demand for LTC increases, therefore we should see a small effect.

So yeah, still stochastic sure, but suddenly a whole lot more predictable. I'm sure there'd be more conventional Bayesian method to do this too, if ML fails I'll be looking at that next.

>> No.8373341

>>8373282

Yep, I've been saving those links. A lot of reading material from this thread, great stuff!

>> No.8373360

>>8373282
>its mainly doing forex stuff

Interesting, see part of the reason I'm using cryptos for my testing is because it's a tiny market, so I'm expecting it to be a bit more predictable.

Gonna have to play more with Forex when it's all ready I think.

>> No.8373436

DAMN EVERYONE IN THIS THREAD IS PROGRAMMING CRYPTO TRADING BOTS AND SHIT? HOLY SHIT I THOUGHT BUZ ONLY HAD PAJEETS AND HIGH SCHOOL KIDS. THAT'S CRAZY SO MANY REPLIES IN THIS THREAD. DAMN I FEEL STUPID NOW THAT I DON'T KNOW WHAT HALF THE SHIT YOU'RE TALKING ABOUT MEANS.

>> No.8373471

>>8365509
I know nothing about coding but thanks, this is helpful. Copied for reference

I want to start a node and learn what a linux computer is in the techno-future but am an absolute brainlet that knows nothing about coding, etc

>> No.8373493

>>8365555
Thanks brah

>> No.8373496

>>8373318
regarding bayesian methods, if it was practically possible to crunch this type of data you could model that non stochastic component absolutely. Unfortunately nobody has figured out how to make mcmc and similar sampling methods more computationally effective yet. Active research is ongoing.

And I totally get what you are saying, especially about the sentiment data, which could be a great predictor for regime changes/directional movement (but then why over complicate with RL?). As in, you provide additional explanatory data.

What I'm saying though is a little bit different. Essentially you are learning some complex transfer function right? To map inputs to outputs. What I'm saying is that unlike a controlled environment, here all of this data is full of stochastic noise. Be it market micro structure noise or whatever else. And these type of models tend to give in eventually and learn the identity function (the random walk basically) or just work well in one specific state and would need to be refitted (computationally heavy). Because of that noise. In those periods without optima you run increased tail risk of shit really going wrong, hence my black box comment

>> No.8373497

>>8368988
Even if I told you, you'd end up poor.

>> No.8373498

>>8373436
>HOLY SHIT I THOUGHT BUZ ONLY HAD PAJEETS AND HIGH SCHOOL KIDS.

Buy my bot sir, best prices sir, guaranteed positive ev sir!

Kek, we do occasionally stop being total autists long enough to swap useful ideas before going back to spamming Chainlink meme

>> No.8373514

>>8371259
But even though you have the price indicator you have no strategy for it. The price will never go between the bands perfect and you'll lose. If it was that easy everyone would do it.

>> No.8373516

>>8373360
forex is definitely way more difficult, your assumption is correct. We would do crypto but its not something we could do completely legally. So I'm just running it on my own binance account.

>> No.8373640

>>8368167
They don't work as well as everyone thinks. You'd be better off checking the market once a day and getting a general feel, then making a decision to stay in a trade or not. You are basically predicting what everyone else is going to do for the next days or month, and that information is not in the price. You can login to message boards and see how people are feeling, and also look back at the larger trends. Also I would never short, because the bots buy the shit back up too often and too fast.

>> No.8373677

>>8373496
>but then why over complicate with RL

Because of this:

>computationally effective

If I could brute-force it I would. RL shines in function approximation - so I figured it'd be a viable approach since I have no clue what said function would even look like, how many params would be needed etc. I tried using simpler Linear Regression based stuff to at least predict and it just didn't work at all (like I think you mentioned earlier, just identity plus a bit of noise).

>here all of this data is full of stochastic noise

I actually clean it up a bit first with a low-pass filter. No idea if that's the right approach, but it seemed to help. Problem is, those little movements ARE the market - filter out too much and you might as well just use a SMA or something.

>Be it market micro structure noise or whatever else

Yep, this is the big issue, it's why I give it SO many inputs that possibly impact the price - I'm trying to force it to NOT learn the identity function, since no 2 states should ever be totally identical - the problem there is, it could NEVER converge (although since A3C runs a bunch of workers at once, at least one of them tends to get it right so I can just spam more computational power and run MORE at once I guess).

>risk of shit really going wrong

Ah, for that I have a MUCH simpler solution - the various actions it can take are fairly restricted, and it only enters bracket trades (trails the orders etc of course). So it's basically running a pretty conventional stops & DCA style system (based on the recent ATR to prevent early triggering, and a few condtions to decide whether to make a DCA buy or just stop out) to keep the capital safe. I also keep track of it's success rate (using Backtrader) and if it's done a bunch of dumb shit, it goes back to paper trading until it's learned it's lesson. Since A3C is an unsupervised algo, if it screws up it doesn't need full retraining on bad screw ups.

>> No.8373709

>>8373640
So are you guys going up against HFT bots? Like Wall Street level shit?

>> No.8373711

>>8365509
Makes sense. Thanks guvnor!

>> No.8373719

>>8365118
c++ program with the following code:
(Headers etc)
int main()
{
main();
return 0;
}

>> No.8373758

>>8373709
Its more like the price isn't predictable on a wider level. HFT is not worth it, unless the exchange has no fees. The exchanges having API timing limits, otherwise people would DDOS them with orders.

>> No.8373793

>>8373514
>But even though you have the price indicator you have no strategy for it. The price will never go between the bands perfect and you'll lose. If it was that easy everyone would do it.

Something people rarely discuss though is how important a good position sizing & capital protection strategy is. This is a lot like poker, your cash IS your main weapon, you need to protect it. There's good strategies around that mean even if you won only 50% of your bets, by cutting the losers (or using DCA to turn thme into winners) and letting winners run you'll make solid gain.

Like I say, I'm making nice regular profits just using a basic mechanical system based on MACD and SMA - it's all about my money management. Now, that'd probably not work in a tougher market (in fact, I know it wouldn't I've backtested it), but since IMO cryptos are, over time, going to keep growing, the market is biased towards bull runs. So even normally non-viable strategies can pay off.

>> No.8373800

>>8373758
thanks, yeah I'm just thinking the code for HFT bots must be so much more insane with each market maker competing with each other in a much more liquid market. at least you have an edge in that way.

>> No.8373805

>>8373677
> RL shines in function approximation
> Yep, this is the big issue, it's why I give it SO many inputs that possibly impact the price
> Problem is, those little movements ARE the marke
Thats it. RL is a good enough general approximator, but not when hidden state is, well hidden. very, very deep beyond anything observable. Look into signals extraction rather than smoothing and feed that in instead. Also, look into traditional lagged decomposition (like wavelets for example, I bet theres a python lib around) and feed those in as additional explanatory variables.
Good luck anon, hopefully we meet again on this fucking mongolian bread baking board

>> No.8373824

how do i build a fullstack website in a funcitonal programming language like racket?

>> No.8373829

>>8373805
>(like wavelets for example, I bet theres a python lib around

Yeah, I've been looking to that recently actually, and I think someone posted about it earlier. Cheers anon, I'm sure we will. Like I say if I crack this shit, I'll probably post a thread to gloat/share ideas!

>> No.8373847

>>8367856
Yes you can!
K thanks papa bless

>> No.8373862

>>8371307
Just you wait, anon. Just you wait...

>> No.8374118

>>8365293
>Python

Trash.

>> No.8374669

>>8372615
I been in ml a while like a year maybe 2 and i only recently strated with cryptos, i thought of using ml but honestly trading is more of a game against other players than a rational market so I started thinking of q learning but this looks great.

>> No.8374681

>>8374118
>language used by literally everyone in the ML community that is literally god-tier for rapid prototyping or not having to worry about trivial implementation details when working with mind-bogglingly complicated mathematics that already occupy too much of your headspace
>trash

lmfao gtfo guy who read 1 programming language blogpost and thinks he's now stroustrup

>> No.8374747

>>8374118
python is good
R is also used
if you can c and c++
I don't know anyone in ml that uses the other things mentioned here

Other things to use include octave,mathematica, docker, cuda, jupyter etc

>> No.8375038
File: 858 KB, 240x228, 1512548029895.gif [View same] [iqdb] [saucenao] [google]
8375038

>>8373318
trying making something profitable before you continue your iamverysmart poasting

>> No.8375149

>>8374681
>lmfao gtfo guy who read 1 programming language blogpost and thinks he's now stroustrup

Lol, Python-only brainlet projecting.

>language used by literally everyone in the ML community

Slow as molasses language for AI? Lmao. Many people shit in the streets. Are you going to shit in the street too?

>rapid prototyping or not having to worry about trivial implementation details

Not unique to Python.

>> No.8375228

>>8365118
/g/ is over there. Go away. saged

>> No.8375327

>>8365364
/dpt/ is not for gay!

>> No.8375588

Check out auton.io
It's easily configurable application for automated trading.