I’m using both OHLCV data and financial statement data. The OHLCV stuff could definitely be used for crypto since it’s the same data format.
My approach with stocks is portfolio based. I have a consumer-producer rating system that determines potential stock picks/allocations, and I will have a consumer that optimizes a portfolio for minimal negative volatility correlation and growth based on the stocks being monitored. All of this rebalances in real-time.
Most of the OHLCV stuff is used for the portfolio side of things, but if you had a volitility based strategy with crypto you could probably use it for that. I dont think there are exact names for all of the indicators I’m using but if you are familiar with beta, sharpe, and sortino they are very similar.
I just released the 10th episode of the course, We will move hardcoded settings from the leader to the database. We will look into the reasons why we should introduce a new database for the naive app instead of using the datawarehouse application’s database. Lastly, we will update the leader to fetch settings from the database.
As far as I understand, that directly depends on your strategy.
There are strategies that are investing on every couple days* - they don’t need access to real time events stream. At that moment you can consider querying API to fetch OHLC(open, high, low, close for that timeframe) data every x minutes. That will cover data source but currently we are also using websocket data to confirm that our order got (partially) filled. This can be achieved by comparing OHLC data with order price(if it falls/raises enough - fetch order to confirm it was filled).
On the other hand it will be nearly impossible to do arbitrage trading using even most granual one minute OHLC data as it’s extremely time sensitive. The same applies to HFT (high frequency trading), again you can buy and sell within seconds with access to real time data.
I need to admit that at least for the Binance subsecond HFT is not really possible as there’s just not enough trading going on as it would be for stock trading where HFT is normally utilized.
Taking above under consideration you are probably fine with querying every one minute OHLC data for most of the non-HFT strategies - for the trading bot videos i picked websocket as it’s gives the feeling of things “being alive” - coolness factor
Hmmm that’s a good question. I believe the idea is to track multiple (tens or even hundreds of) pairs and based on price movement take decisions to buy in or sell - it’s doable for a few pairs but not for that many.
The 12th episode is out! This time we focus on leveraging the Task abstraction to simplify the autostarting and supervision tree of the Naive application. We will look into how we could stop tracking the trading symbols and drop the Naive.Server altogether.
This one is a little bit different, would love to get some comments about the new format
I just bought your book and will like to thank you for all your hard work. I like how you don’t hide anything from the reader/watcher in that, you make all the decisions and choices you’re making clear.
You also teach a bit more I think, especially, for those new to programming by walking through other library code and documentation in github. It’s an invaluable skill which may sometimes feel a bit scary for a learner.
What’s the best way to notifiy you about issues with the book? Found a couple to far
I love that you started with a nice tone and then gave me a punch regards the “issues” (just kidding)
Thank you very much for your kind words - that was my intention, idea is to show people that it doesn’t need to be neither perfect nor “best”. It needs to work and it’s an interactive process and Elixir(and functional programming in general) makes it easier to manage those refactoring upgrades as your understanding of the domain grows.
There are 2 repositories each attached to a different stream of work:
They are different as code is different between those two (not dramatically but the book is definitely “streamlined” - I’ve learnt some lessons from the videos on the way which I’ve put in the book).
Thank you once again for buying a copy and feel free to create issues or even PRs if you fancy contributing to my effort - any help would be tremendously appreciated!
We will focus on creating a supervision tree around our streamer processes that will allow us to start and stop streaming on a symbol. To keep things in sync with the improvements made to the Naive application in the last episode, we will also introduce the autostarting functionality based on the settings from the database.
I’ve also redone the 12th video and uploaded it again so it follows the style of the series a little bit closer.
I guesstimate it to be about 75% finished and with 15 chapters, it’s 200+ pages long.
Newest release contains 3 additional chapters:
“Abstract duplicated supervision code” - we will venture into abstracting away the supervision logic that we copied in the previous chapters by leveraging refactoring and macros. This chapter contains a full refactoring session.
“Store trade events and orders inside the database” - we implement a new application that will be responsible for storing data from the PubSub topics. Additionally, we will look into how we could make the supervision tree even better by introducing Elixir Registry.
“Backtest trading strategy” - based on improvements from previous chapters we will be able to implement an extremely simple backtesting method that will stream trade events from the database to PubSub topic
I would like to say that I’m gratefully thankful for all the support from the Elixir community with this project(both book and videos) - I couldn’t do this without you
We will focus on refactoring the duplicated logic responsible for supervising(starting, stopping, and autostarting) the dynamic processes inside the naive and the streamer applications. First, we will abstract away all the generic code leaving just a boilerplate inside the naive application. Next, we will look into the “using” macro which we will leverage to get rid of that boilerplate. This video was released for educational purposes as the proper way of solving this problem would be to use the Registry(which will be the focus of the next episode).