пройди на обучение https://bit.ly/3ggw1Rk
Tags: bitcoin cryptocurrencies data model database design model design trading stocks
Trading cryptocurrencies. buying stocks. and the like is extremely popular these days — it’s perceived as easy profit. Prices are currently rising. but we can’t know when that will change. On the other hand. we know it will at some point. But we’re not here to make financial predictions. Instead. we’ll talk about a data model that can be used to support the trade of cryptocurrencies and financial instruments like stocks or fund shares.
What You Need to Know About Trading Currencies and Shares Technological improvements in the last few decades have had a significant impact on trading. There are now many online trading platforms you can use. Most of today’s trading is done virtually — you can see paper stocks in museums. but you’re not likely to see the stocks you buy in paper form. And you don’t need to pack your bags and head to Wall Street or any other stock exchange to make a trade. From the comfort of your own computer or mobile device. you can buy or sell financial derivatives (such as bonds. shares. or commodities).
Most trades (sales of financial derivatives) follow the same rules. There are sellers and buyers. If they agree on a price. the trade happens. After the trade. the price of that financial derivative will be recalculated and the process will continue with new traders. Shares and other derivatives work the same way.
What is cryptocurrency? You’ve probably heard of Bitcoin and other cryptocurrencies. But what are they? Cryptocurrencies are like virtual currencies. but they’re not tied to real-world currencies (like euros or dollars). Instead. users can trade cryptocurrencies amongst themselves like tokens. They can then negotiate a sale that turns their tokens into actual money. These sales function exactly like the stock and share trades described above.
This subject is complex and we could have a lot of details in our model (e. g. records of documents and transactions). I’m going to keep it simple; I won’t implement any kind of automatic trading or any formulas to generate new prices after a trade event.
The Currencies subject area is simple. It contains four tables that store every currency we use and their exchange rates. Currencies are important because:
We will use one currency. called the base currency. for trading. An online stock trading platform will likely use the U. S. dollar (USD) as its base currency. regardless of the traders’ actual regions. All transactions will be converted into the base currency. We can also have non-base or local currencies for all the countries where our trading platform is available. This would allow us to display prices in the local currency but still perform trades in the base currency. The remaining two tables relate currencies and countries.
The most important table in this subject area is the currency table. This is where we’ll store all currencies we’ve ever used for trading. including cryptocurrencies. Whether a currency is included in this table depends on if that currency will be used to pay for the traded items. For each currency. we’ll store:
Code — A code used to UNIQUELY denote that currency. For national currencies. this will be the ISO 4217 code (e. g. USD for United States Dollar) or some other official code. We could also use ISO 4217 for cryptocurrencies; XBT is Bitcoin’s ISO code. However. Bitcoin also uses the code BTC informally. name — That currency’s UNIQUE name (e. g. United States Dollar). is_active — If the currency is currently active in our system. is_base — If this currency is our system’s base currency. Usually. we’ll have only one base currency at a time. It’s possible we could have more than one. such as using euros for EU states and US dollars for other areas. In that case. we have the capability assign a base currency to each country with this attribute. The next table stores current and historical rates between currency pairs. In the currency_rate table. we’ll store the currency_id we want to compare to a base_currency_id as well as the rate when this pair was stored (ts). Since we’ll store rates as they were at various points in time. this table will store both historical and current data.
The broker can act as an intermediary and match a customer’s buy order with a third-party’s sell order or vice versa. In this capacity. the broker acts as an agent receiving a commission.
The broker can act as a principal and meet a customer’s order from its own inventory. Revenue from this activity falls under the heading ‘principal transactions’ and may include gains and losses on the brokerage’s own investments.
Full service brokerage firms continue to offer stock reports and a higher level of service than other brokerage houses. Discount brokerage houses dedicate themselves to execute orders for clients.
NASDAQ trades approximately 2 billion shares daily for over 3. 100 listed companies. The NYSE trades over 5 billion shares per day. The World Federation of Exchanges estimated the total market capitalization of stocks on all of the world’s significant exchanges at $51. 6 trillion as of August 2011 with shares available in more than 46. 000 companies. The Brokerage industry model set consists of Enterprise. Business Area. and Data Warehouse logical data models specifically developed for companies providing brokerage and securities trading services.
The Brokerage data models provide a complete and comprehensive front office data architecture that can be applied across the organization for applications development. reporting and analytics.
This article discusses the guidelines and outline to build a trading model for forex or currency trading. Also discussed are the relevant points about how forex trading is different than equity trading. as well as specific points to be considered for building the forex trading model.
As a general thought and process flow. building a trading strategy can be captured within the following steps. as demonstrated in this figure:
Identify/Conceptualize a Trading Strategy Building a trading model requires identifying suitable opportunities. which in turn involves choosing any defined strategies. or conceptualizing new ones as variants of standard ones. Trading strategy remains the heart of any trading model. as it clearly dictates the rules to be followed. entry/exit points. profit potential. duration of trade. risk management criteria. etc. For e. g. . here are two popular forex trading strategies:
Profit Levels (like pips movement) Stop Loss LevelsMoney Management: How much money to bet on each trade. in which style (fix amount per trade or variable amounts with progressive changes) Risk Management and scenarios analysis consideration. as applicable One may start with a few assumptions. and fine-tune those as more iterative tests are conducted to find the best profitable fit.
Iterative Analysis for Trading Model Developing a trading model requires patient analysis. which includes numerous iterations by repetitive changes to mathematical parameters. as well as variations in underlying theoretical concepts. During this cycle. it helps to record the failure and success cases. so as to keep a record of what works and what’s not. which are useful over the long years of trading career.
Using Computers for Trade Automation and Model Building Today. it’s trendy to attempt to automate everything. But remember: “The program is as efficient as the underlying concepts and the practical implementation built in it. “
Computers can be used to search for patterns in historical data which can form the basis of developing new models. Back testing can also be aided by computer programs being run against historical data.
One can either use the available applications on trial or purchase basis. or build new ones on their own for their requirements based on their familiarity with computer programming. Be sure to use the computer programs with a full understanding and applicability to your own selected strategies. to avoid any pitfalls later with real money trading.
The Bottom Line One major advantage of using trading models is that it takes away the emotional attachments and mental roadblocks while trading. which are known to be the major reasons for trade failures and losses. While it’s always exciting to trade through established models in a defined and systematic way. wise traders always keep looking for possibility of failures and continuous customization for further success. based on market developments. A pragmatic approach. with continuous monitoring and improvements can help profitable opportunities through trading models.