rm-rf-etc

rm-rf-etc

Stock trading in Elixir

I have a private project which I’m thinking of making public, but I want to first see if there’s interest.

I think elixir is an excellent language for running automated trading strategies, and so I decided to build what I need from mostly scratch.

So far I have a state machine which tracks stock activity in whatever timeframe specified, and I have the code for the ATR, RSI, and MACD indicators. Each has been closely checked against the output from TradingView.

I’ve also written one strategy and done some semi-successful backtests but I’m still working to increase the quality of how backtests are conducted (to be more realistic).

I’m fine with keeping it private, but if others want to contribute I certainly wouldn’t mind the help.

Most Liked

CinderellaMan

CinderellaMan

@PJUllrich Indeed, I would be very interested - especially in those indicators - I would totally steal them :slight_smile:

@rm-rf-etc TLDR: Please release it, many people will benefit from it :slight_smile: but it’s hard work to get contributions.

On a more serious note, I released a cryptocurrency trading “environment” last year and I believe that some people are/were using it but you need tons of marketing, introduction materials and tutorials, and “stuff” to get people excited to the extent of contribution. At least for me, it didn’t work out this way (and I had similar hopes that people will contribute as they will be using it and we will make it better together).

I think there are multiple reasons for it:

  • some people just want to use a product (they don’t care about the code so much, Elixir makes it easier for them to modify it a bit and that’s it)
  • some people are overwhelmed by the scale of the project (they need more dev docs etc - do you have any of those?)
  • some people aren’t interested in the product, but they want to understand it for learning purposes - again you need even more dev docs

I would love to see more algo trading related stuff being released to the community as it would enforce the idea that this is what Elixir is good at, but it’s probably too early to expect people to contribute (it requires lots of non-coding related effort from you).

For me, to get people interested I gave up on docs etc - I started to record youtube videos and I can see people being interested far more than in “finished” code - maybe that’s the way to get people excited to do it - through videos develop system up to the level when people feel comfortable to contribute as they fully understand the design decision behind it.

I hope that this didn’t come across negative - I think we have a great Elixir community and chance here are much better to extend your project than in any other language.

rm-rf-etc

rm-rf-etc

I’m working on something pretty fun right now, it’s a rust NIF for performant chart analysis. PineScript is a really efficient language for testing ideas, but its usefulness falls off as soon as you get past the basics, so I think there’s a neat opportunity to build an equivalent in elixir and rust.

The way that PineScript works under the hood is that it generates a table, where every candlestick in the chart is a new row in the table, and each variable in your script generates a column in the table. So I prototyped a fixed-length rolling table in elixir, but I think the performance boost from using rust and a NIF would be worthwhile. I’ve also wanted the opportunity to write a NIF, and just needed a use case I’m invested in.

Some additional motivation: PineScript also has zero support for strategies that involve more than one asset, so strategies like stat-arb are out of the question. I’m planning on solving that, as well as portfolio-wide testing.

I’ve spent a lot of time with QuantConnect lately but I keep coming back to elixir because python and C# both irritate me.

I will probably reimplement the trade indicators in rust and provide a NIF for elixir. I’m also thinking about the potential to write elixir macros to make indicators and trading rules really concise, but I don’t know if that will be warranted, I’ll see when I get there.

Just wanted to share this in case anybody is interested.

subhrashisdas

subhrashisdas

I am interested. I am learning this language to build personal stock trading platform.

Where Next?

Popular in Discussions Top

ricklove
I was just introduced to Elixir and Phoenix. I was told about the 2 million websocket test that was done 2 years ago. From my research, t...
New
WolfDan
After doing a port from a c++ library to my project in phoenix I’ve seen that I need a faster way to run this algorithm and I found this ...
New
griffinbyatt
Sobelow Sobelow is a security-focused static analysis tool for the Phoenix framework. For security researchers, it is a useful tool for g...
New
rower687
Hi all, I’ve been reading a lot about the “let it crash” term and how supervising processes and the whole messaging passing make an elixi...
New
crabonature
I’m still quite new to Elixir. As I understand we got in Elixir “multi guards” as convention to simplify one large guard with or’s?: de...
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39523 209
New
crispinb
On reading dhh’s latest The One Person Framework it strikes me that Phoenix with LiveView is already pretty much this. However, never hav...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
johnnyicon
Hi all, I’ve just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I’m trying to use Postgres...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29703 241
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement