andywuest / harbour-watchlist

A stock watchlist for SailfishOS
10 stars 7 forks source link

Add Russian Stock Exchage, please #18

Open dikonov opened 4 years ago

dikonov commented 4 years ago

Please add the Moscow Stock Exchange MOEX (https://www.moex.com/en/) as a data source. Watchlist cannot see my stocks listed there.

Here are some links to the MOEX API. https://cdn-dr.moex.com/a2193 : Official link with some sample code (https://fs.moex.com/files/6524) https://habr.com/ru/post/332700/ : A tutorial on collecting data from MOEX.

The links are in Russian, but the provided code is not.

Some background info: Russia is going through a "savings revolution" now because the bank deposit rates went below 10% and gradually dropped to 4-5%. Many people started looking for alternatives and Russian stocks is one of them. The government tries to stimulate small private investments by giving limited tax exemptions. This makes Watchlist an important app for an increasing group of people.

andywuest commented 4 years ago

i will have a look at it. on the first look it seems to be possible . what stocks do you need? is RTS index with the 50 biggest companies sufficient or do you need more? what other relevant indices do exist in the MOEX? can you provide some company names you need?

A new backend means that you will only be able to use stocks from that backend - there will be no mixing of stocks from different backends. you will have to choose the backend - and you will only be able to get the stocks from the specific backend. shouldn't be a problem if you can create multiple watchlist with different backends - however this needs to be implemented first.

https://www.finanzen.net/index/rts

Time is the only limiting factor for me :-(

dikonov commented 4 years ago

i will have a look at it. on the first look it seems to be possible . what stocks do you need? is RTS index with the 50 biggest companies sufficient or do you need more? https://www.finanzen.net/index/rts

RTSI / IMOEX is a great first step. That would help me a lot because it covers the most popular stocks (GAZP, YNDX, SBER, PLZL etc), including the ones that interest me now. However, other instruments (including bonds) should not be neglected. There are other users of the "Russian" mobile OS and INOI devices and they will need more.

what other relevant indices do exist in the MOEX? can you provide some company names you need?

Here is the full list: https://www.moex.com/en/indices

A new backend means that you will only be able to use stocks from that backend

It is OK for a quick solution. This sounds as a purely technical restriction that can be fixed later by adding some code to combine data from different backends. Many apps have the same problem.

dikonov commented 4 years ago

Here is a query reference page of the Moscow Exchange ISS (Information Statistical Server) https://iss.moex.com/iss/reference/

https://translate.google.com/translate?sl=ru&tl=en&u=https%3A%2F%2Fiss.moex.com%2Fiss%2Freference%2F

Hope it helps.

A sample quiery for prices of a particular stock https://iss.moex.com/iss/engines/stock/markets/shares/securities/AFLT/trades.xml

andywuest commented 4 years ago

started with the moex in a separate branch - search seems to work. so far i use the english version. later the cyrillic can be used. feel free to try it.

dikonov commented 4 years ago

I do not have a working build environment, so I have to wait for a binary build.

andywuest commented 4 years ago

ok. i have now a first shot. it looks like this. for some reason the currency code given by the moex is "SUR" -> can i map that into "RUB" ? Can you also give me some stocks from the "second row" - the bigger stocks from the RTS seem to work - however so far no history. russian_market

dikonov commented 4 years ago

The prices look correct. The currency code should indeed be RUB and its currency symbor is (₽) U+20BD.

As far as I understand, you need to get the ticker (AFLT, GAZP, YNDX...) for the ISS quiery and the server will supply the app with an XML containing prices for some period suitable to build graphs. An example for Aeroflot (AFLT) was given above. The same ticker string is userful to construct a link for a news feed.

It would be useful to support displaying tickers (e.g. using darker color) beside names and search by tickers too.

I do not really know, what companies are 1st and what are 2nd row. Some smaller emitents: OSMP, APTK, UFMO. Megafon (MFON, a giant telekom which does not rely on the stock market and has support from the state) could be taken as an example of a stock that is present, but has low volume of deals. Its price can stay constant for several days even during panic.

The terminal for MOEX shows a tree list with all possible shares, bonds, ETFs, etc. I can try to screenshot that list, if you need it (it cannot be selected for textual copy), but it is 90% Cyrillic, except foreign trademarks and some acronyms.

andywuest commented 4 years ago

Ok. I have some more updates:

andywuest commented 4 years ago

moex_1 moex_2

dikonov commented 4 years ago

Great news and I am anxious to test it. Is there a pre-built package spmewhere? I can install the SFOS RUS SDK and attempt to compile it, but I need a step-by-step instruction. I know how to build rpms for my desktop system, but I have never done any cross-compilation.

dikonov commented 4 years ago

I figured out why the currency code was SUR and no RUB. SUR is Soviet Union Rouble! Likewise we have sites in the .su domain in addition to .ru and .рф.