Previously I wrote about some basic assumptions and first use cases that could be distinguished in my project for the DSP2017. Today I will dive deeper into the topic and cover the quotation sheet for company-level information as well as types of commissions along with additional conditions that might come in handy to the investors. As a reminder, I’m using a book called “Giełda – podstawy inwestowania” by Adam Zaremba as a source. Let’s continue with the research.
To compliment the commission sheet, the user should have access to a quotation sheet which will store information about a company present on the stock market. This sheet should contain data such as:
- Company name
- Opening reference rate
- Opening rate
- A partial commission sheet
- Current rate
- Volume of the last transaction
- Stock value change (percentage)
- Time of the last transaction
- Volume of the traded stocks
- Value of the traded stocks
Apart from being a list of use cases, this is a great indication of what the model of a company within the simulator will look like. Some of these points require additional description. Opening reference rate is the price at which the last trade was made during the last day, it may also be called the “closing rate”. The opening rate is the price set before a session begins. This might be confusing – “if the closing rate is price of the last trade, then when was this opening rate set?” – the issue is connected to the quotation system itself and what happens between the sessions. We will discuss this a little later. The partial commission sheet is pretty straightforward, to keep things simple it will keep information about the top row from the main sheet. The current rate is the price of the last trade that has completed. Based on that the stock value change is calculated. We also have data such as the time and volume (number of stocks traded) that the last transaction completed. The last two elements hold information about the overall volume and value of every trade completed during current session.
This is something that we can start working with! We have all the elements that should be modeled in the simulator, to achieve a believable representation of a company. But there is no market without some actual trading. This is how we come to the commission types.
There are two basic categories that the commissions fall into: with and without price limit. If the user would wish to order the first type of commission, he would need to set the specific price, for which he wishes to sell, or buy shares. The trade is completed only if there is a corresponding offer for this very price. It is pretty intuitive and should be the basic commission type implemented in the simulator. There are two additional rules when comes to this method. First one is the priority of price, which means that an offer more advantegous to the other party will be realized earlier. The second rule is the priority of time. Simply put, between two offers that are equal in price, the one that was made earlier, will also be chosen earlier.
Commission without price limit can be distinguished into three sub-types: for any price, for the current rate and for the opening rate. The first one is a brutal buy/sell commission that disregards the prices, it goes through the commission sheet from the top and executes every offer until it satisfies the amount that was specified by the user. That means there might be more than one rate for such a commission, which happens if the first order on the sheet has a volume that doesn’t meet the requirement. Commission for the current rate limits this. It will complete only the first item on the sheet and it will create a new order, at this very price, to compliment the difference in volume. The last type which is based on the opening rate is more complex, as it branches out even further. Therefore I will postpone it’s implementation.
The user now has three different ways to acquire and sell stocks. But, to add some flavour and extend the possible strategies, I need to consider the additional conditions. Following the golden rule, of making it realistically simple, I will limit myself to a single one: activation limit.
Activation limit introduces a new concept, the commissions can be inactive, which means they can be issued by the user, but they’re not automatically part of the commission sheet. When user sets the activation limit, he should pass two variables: the activation value and the price. The first one corresponds to the current rate, if it achieves this level, the commission activates and is transfered to the sheet with the price determined by the second variable. This is called a “stop limit” variant. There is also a “stop loss” variant which activates when the current rate drops to match the limit. This causes a sell for any price commission to fire and is a quick bail-out mechanic.
Now it’s finally coming together. With this much data I think it’s possible to finally start the implementation, at least to a certain degree. So please stay tuned for the second technical-oriented post. As always, thank You for reading and until next time!