Today, the concept of futures and options is one of the most frequently uttered in the market. Let\u0027s get acquainted with these financial instruments, give them concepts and consider the mechanism of their use. Futures and options are derivatives, and they are also called derivatives. When buying these financial instruments, the trader does not get the asset itself (stock, bond, etc.), but a contract – an opportunity to perform a purchase and sale operation in the future, at a fixed price. Simply put, a derivative is an insurance that protects the trader from possible adverse fluctuations in the price of the main asset futures-option-trading-system.jpg Little history. Initially, derivatives were created to reduce the possible risks of producers of certain assets in the form of goods. Let\u0027s look at a simple example: Company A produces flour, which is its basic asset. Today, on the conditional market, company A can purchase a contract for the sale of 10,000 tons of flour for $100, with a sales period of 3 months. In fact, after 3 months, company A can sell its flour for a fixed $100, despite the fact that the cost of flour may fall to $80. With this contract, the company predicts and fixes its income, which will be $1,000,000, and the contract is called - futures, a contract \"for the future\". There is a possibility that the cost of flour will increase to $120 per ton, and in this case, company A will receive less than $200,000, since the market value of 10,000 tons of flour will be $1200,000. The buyer of such a contract can be company B, which is engaged in the production of bread, and therefore the market price of flour is also important for it. A private trader needs derivatives in order to get a fixed price of a purchase and sale transaction, such as a stock or currency, as well as an asset that cannot be purchased by a trader, such as oil. financial-furures-contracrt.jpg Let\u0027s talk about which futures and options are the most popular in the world right now. Today, the most\" popular \" are derivatives for currency, stocks, precious metals, and oil. It is worth saying that a little more than 10 years ago, the purchase of a futures contract meant the delivery of a real asset, that is, in our case, the delivery of flour. Today, the lion\u0027s share of derivatives are non-deliverable, and on the day of the end of the contract, counterparties are paid in money. Let\u0027s look at the mechanism in our example. So by the end of the contract, company A must receive a fixed $ 1,000,000 under the terms of the futures contract, which must be paid by company B. Since their derivative is non-deliverable, at the end of the contract period, company A will not supply flour to company B. What\u0027s going on? Company A displays the tonnage of flour on the commodity exchange, with the possibility to sell it to any company, including company B. the tonnage is received at a warehouse accredited by this exchange. At the same time, company B has the opportunity to purchase its 10,000 tons set by futures from another company and receive them at another warehouse accredited by the exchange. futures-trading.jpg The price of flour may change, and may not be equal to the set price in the contract. - Let the price drop to $80 per ton. In this case, company A sells its asset at $80 per ton, receiving $800,000, and the remaining $200,000 is paid to it by company B, so in total, company A will receive $1,000,000. At the same time, company B will buy 10,000 tons of flour for $80 from another supplier, spending $800,000, and with the amount of future compensation paid to company A in the amount of $200,000, its total expense will be $1,000,000, as planned. - If the cost of flour increases to $120, in this case, the difference will be paid by company A to company B. Many novice traders have a question about the possibilities of trading options and futures in various markets, for example, stocks and bonds. The answer is Yes. However, there are restrictions related to the duration of such contracts. In our example – 3 months. If the contract was conditionally concluded in June, it ends in September. The value of a derivative always depends directly on the value of the underlying asset, and the value of both instruments tends to be equal. Because of this dependence, futures and options are called derivatives. Traders earn money using derivatives, for example, on arbitrage transactions, but at the same time derivatives do not cease to play an important role in hedging operations – insurance of transactions. Let\u0027s take a closer look at the features of both financial instruments. Let\u0027s start with futures. Futures a contract that involves the sale of the underlying asset at a fixed price, with a set delay in execution-payment. Futures fix the purchase or sale price of the underlying asset at the expiration of the term, and the market value of the asset may change. If the futures contract is non-deliverable, then only monetary payments between the parties to the contract are made on it. It is worth saying that the delivery of the asset does not necessarily have to be made on time, in other things, as well as the purchase, but in this case there is a probability of price changes, and the risk of loss of profit. Consider the mechanism for concluding a futures contract. The contract is concluded exclusively on the exchange. The seller puts his offer on the exchange with its price, volume, and due date. After a buyer appears who agrees to these terms and conditions. The seller can also choose a ready-made request from the buyer, which has a set price, volume and deadline for execution. This list of applications is always present on the exchange, and applications often differ little. Any of the participants in the transaction sees this list and chooses the most suitable one for them according to the condition. This list is called a glass and is displayed in the program that traders use. The greater the depth of the glass, the more flexible it is possible to enter into contracts, viewing more offers and as a result choosing the most suitable conditions in the case of the buyer, and at the same time more likely to conclude a contract in the case of the seller. Some trading programs allow you to set the depth of order book, for example, Terminal, where you can set your desired depth. The order book in the Terminal program is shown below. trade-terminal-system.png Obligations to execute futures are transferred to the exchange. When the date of execution of the futures contract and the conditions under which the seller will be obliged to pay remuneration (if the price of the asset has fallen), the exchange itself transfers the amount to the seller\u0027s account and withholds this amount from the buyer\u0027s account. If there is a situation that the buyer\u0027s account of the contract does not have the necessary amount, then this will be a problem that will be solved by the exchange, not the seller. The situation is the same in the opposite case if the seller must pay compensation to the buyer. The exchange carries risks, so before entering into contracts, both parties make a cash Deposit calculated according to the exchange\u0027s formula. Most often, its value can be double the size of the fluctuation of the futures price in one day. So if the price fluctuation was 3 %, then the collateral may be 6% of the price of the futures contract. The Deposit is refundable, and is returned to the account of the parties after the execution of the futures. If the participant refuses to fulfill the contract, the Deposit will be deducted from the exchange\u0027s account as compensation. Sometimes there is a need for early termination of the contract, in which case its value will be equal to the value calculated by the exchange on the day of termination. That is, the exchange calculates the price of the contract on a daily basis, while it uses its own rules for calculating the cost, but focuses on the prices that are offered on the market by bidders. As mentioned earlier, the price of the futures is slightly lower than the value of the underlying asset, but the difference is small. Sometimes there is a short-term gap that is associated with market situations, which allows you to earn using an arbitration transaction. You can also make money on futures during the day. So the exchange recalculates the price of the futures, respectively, every day, when its price increases, it charges the difference between the value of the contract and its current value, while the amount of collateral also increases. When the contract execution time comes, the price of the futures becomes equal to the market value of the asset. In General, we can say that a futures contract is a convenient financial instrument that allows you to reduce financial risks. At the same time, speculative operations with this tool are quite complex and, often, it is possible to make money on them using automated tools, such as trading robots. For example, the trading robot \"Edward\". The next financial instrument is an option. This is also a contract, but not for the amount of the sale or purchase, but for the opportunity to buy or sell the underlying asset at a fixed price at a specified time. By type of transaction options are: - Call option – an option to purchase; - Put option – a sell option. option-trade.jpg Option contracts are also traded only on the stock exchange. The participant who bought the option has the right to refuse the transaction at any time if it is not profitable for him, while the seller of the option has no right to refuse it. Thus, if the buyer uses the right of the transaction, the seller is obliged to fulfill it. This condition makes this financial instrument very difficult for an inexperienced user, and allows him to trade confidently using various trading robots or trading systems, coupled with the ability to predict possible market situations. An option can be said to be insurance against possible losses. In case of refusal, the buyer loses an amount equal to the value of the option, which is insignificant in comparison with possible losses. This amount is the seller\u0027s premium. Considered example: Trader A purchased 100 shares of Trend LLC at $10 per share. He plans to sell these shares in 2 months. Trader B offers him an option contract for the sale of 100 shares of the Trehd LLC, with a period of 2 months for the price of $15 per share. The option price is $100. Let\u0027s assume that the transaction took place, let\u0027s consider two possible scenarios: - Let\u0027s assume that the price of the Trend company\u0027s shares fell to $7 per share by the time the option was exercised. In this case, trader A will not only not lose, but also earn. $1500 (optional sale) - $1000 (initial costs) - $100 (seller\u0027s premium) = $400 -profit . - Let\u0027s assume the share price has increased to $17 per share. Thus, the trader had to waste $100 on the purchase of the option. $1700 (optional sale) - $1000 (initial costs) - $100 (seller\u0027s premium) = $600 -profit. And without the option, the profit would have been $700. An option, like a futures contract, is a non-deliverable contract. If the buyer uses the option, the seller will simply pay the difference between the current price of the asset on the market and the option price. Put-option-trading.jpg As mentioned earlier, trading on the stock exchange using options is quite complex, and a market participant needs to be able to predict situations. For call options, you must set a price that will be lower than the expected price after a set period, for a put option, on the contrary, higher than the expected price. Option prices are calculated using statistical data on fluctuations in the asset value. Many users are helped in this by various programs, trading strategies, and trading robots that calculate situations using market data. which for example can be obtained in Hydra. The one who sells the option is exposed to greater risk, its profit is the value of the option, and the loss is unlimited, as it depends on the price fluctuation. Any transactions with derivatives are associated with various risks. The task of the trader is to choose the optimal solution, including the choice of an asset, a trading platform, a strategy, and a trading robot. Manual trading does not bring the necessary income on speculative transactions, so working with trading robots makes the trader\u0027s work profitable if the conditions are chosen correctly.
Creating a strategy in the Designer program. Let’s discuss an example of creating a trading strategy in a program based on the MACD indicator values. The indicator’s goal is as follows: 1. If the MACD indicator histogram crosses the zero line from top to bottom, this is a sell signal. 2. The transition of the histogram from the negative to the positive zone is a buy signal. Therefore, it is necessary to create conditions under which a trade will be made, namely, if the indicator value on the next candle changes its sign, then the signal is sent to make a trade. To create a strategy, we need: - Run the program. 1.png - Select the Variable, Candles and Chart Panel blocks, connect them. 2.png - Select an instrument with which we will test the strategy. 3.png - Plot a candle chart. 4.png - Select the Indicator and Chart Panel blocks. Connect the Indicator and Candles blocks. 5.png - Plot a chart of the MACD indicator. 6.png - Select the Variable block and assign it a numeric value of 0 for further comparison with the indicator value. 7.png - Select the Comparison block and set the test condition in the properties: execution during the test, with the MACD indicator value greater than 0. - Add two Variable blocks and Comparison block. One of the variables is set to -1 in the block properties. It will indicate the transition of the MACD curve value from negative to positive area. The second Variable value is set to 0 in the properties, that will indicate the initial indicator value. - Set the condition in the Comparison block that will be fulfilled if the initial indicator value for the time frame is greater than the current one. - Connect the Variable blocks via a trigger socket with the Comparison blocks, as shown in the figure. Select the Logical Condition and Variable cubes. 8.png - The execution condition of two comparisons will be checked in the Logical Condition cube. Set the AND condition in the properties of the Logical Condition cube and connect the cubes as shown in the figure. 9.png - Set the value equal to -1 in the Variable cube and connect it with the Logical Condition cube via a trigger socket, and through the output connect to the input of the cube with a value of 0. This will allow overwriting the checkbox value when conditions are met, indicating within what range of values the MACD indicator curve is. 10.png - Select the Open Position block, select the Buy direction in the settings and connect data and trigger with the socket, as shown in the figure. 11.png - Select two Variable blocks in which to set the volume and portfolio for trading. Connect them with the corresponding sockets of the Open Position block. 12.png - Similarly, create a routine for the Sales execution. 13.png -The strategy is ready, let’s run it. 14.png
https://youtu.be/st0zTuKX_Fg In order to download market data to the Designer program for testing a trading strategy, you need to do the following: 1.Run the program. 1.png 2. Select the Market Data section in the top menu and click on it. 2.png 3. In the window that appears, select the Download Securities button in the Securities panel, in the menu that appears, tick the All option and select the storage. Then click the OK button . 2а.png 4. In the list of downloaded securities, select the one we need. 3.png 4.png 5. Choose a period for which we need market data, and candles that we need. 5.png 6.png 6. Select the path to storage where our market data will be stored, for this, we click the “+” button. 7.png 7. In the menu that appears, select the full path to store the downloaded market data. 8.png 8. Click the Start button 9. In the window that appears, select the market data source. 9.png 10. In the window that appears, click the “+” button and select the source we need from the drop-down list. 10.png 11.png 12.png 11. Click the OK button. 13.png Market data downloaded to your storage. Enjoy using.
Dear Friends, the new version of our data loader 8 is available for download! From the fundamental changes we want to note: 1. Create indexes and continuous futures directly in Hydra! Using the downloaded data you can build your own indexes, apply popular mathematical functions to calculate them, build graphs on them and save them as a separate security https://www.youtube.com/watch?v=zcNSi1imTcY 2. Added export to Excel or csv option boards, which is built and saved with Hydra. Get an array of data for analysis is now very simple! 3. Preservation of the constructed index, candles, market depthes. For example, in step 1, we built a GOOG price index to AAPL or candles from ticks, or a market depth from a log order, so that tomorrow we do not need to build it again, we have added the function of saving the result as a separate tool.. 4. Extended the functionality of building candles! . The new version of Hydra allows you to build candles from the best bid, ask, spread or classically by trades! 5. FIX server mode is implemented. If before Hydra in server mode sent data as files, now the translation can be done in a professional FIX / FAST format. We hope these changes will be useful to all algot traders. We remind you that the program is distributed for free. \u003e\u003e Download \u003c\u003c
Dear friends We have released new version of our history data downloader S#.Data (Hydra). Every version we improve the design and make the Hydra more friendly and powerful: 1. Options support! Hydra now show options desk, volatility (implied and historical). Or can evaluate it uses historical data. 2. Wanna smile? Enjoy! 3. Importing now extremely easy. We hope the changes will useful for all algorithmic traders, including you. Please do not forget - the software is available for free! \u003e\u003e Download \u003c\u003c
In our today\u0027s article, we will talk about where to go for free or for a relatively small amount of money to download historical data on the US market, as well as about a universal way to download, store, analyze and use in your own algorithms all types of market data. First, let\u0027s concern the main sources of market data on US securities with a brief description of them. In general, there are three types of sources: 1. Sources of historical data, such as exchanges, which provide trading history on their own sites (of course, we do not consider direct connections, which are of type 2). 2. Sources of market data, such as broker terminals, through which it is possible to download also some history, but the main interest is what is happening right now. 3. Multifunctional sources that combine the type 1 and type 2, and usually presented by specialized services. The first type of sources includes sites such as Google and Yahoo Finance: image002.gif The apparent advantage of these services is their full free, but on the other hand, it is impossible to download intraday market data, as well as impossible to get anything other than candles. By this we mean the data such as Level1, Order Log, Market Depth, etc. This practically eliminates the possibility of using the data for testing strategies involving the intraday trading. On the other hand, if your strategy assumes a medium-term trade, for example, based on the Turtle approach, or you practice portfolio investments without too frequent portfolio shake-up, then use of data from these sources to be very reasonable and appropriate. The sources of market data as already described above, are, primarily, broker terminals or other connections to the broker, which every practitioner trader has. For example: Fusion/Blackwood, Rithmic, Gain Capital, OEC Trader, Sterling, etc. image003.png Benefits from the use of this source can be seen almost immediately. First, it is free (of course excluding those fees that you pay to the broker). Second, it is large amount of data that can be obtained: some types of candles, ticks, Level1, DOM etc. On the downside, there are the lack of deep history and the need to collect the necessary data using cunning way, when it is nothing to do without specialized software. With this approach your capabilities for testing are greatly enhanced. There is a possibility to create not only intraday strategies, but also high-frequency algorithms based on historical regularities found. Multifunctional sources are mostly specialized services that provide a real-time market data as well as any requested history, for example IQFeed. image006.gif The main advantage of this source is its versatility and fullness of the data, i.e. at any time it is possible to get any desired data by the user’s request such as ticks, candles, order books etc. The downside of this approach is the payment for this service, the price of which starts from $50 per month for the basic version. If there is a desire to get a few more, it is necessary to connect the additional functions which, as you already understood, will cost money too. But like the previous option, you will need a special program to collect and store the data. Since, at the end of your subscription, you will lose all data. Plus, though the depth of history is more than at the previous method, but it is still limited. Especially for tick data. Now we can proceed to the most interesting, but how do we get the history optimally and do not spend a lot of money. In our opinion, the common approach is as follows: - to download the daily candles from a free source, and to test your strategy preliminary on these data; - to download intraday data through your broker, and to test the strategy in more detail; - the purchase of a subscription to a paid service, and downloading the data array of interest. In order to realize suchlike a specialized software will be necessary to download the required data from the required service for you first, and then it will continue to collect the data from your broker in a common format. Thus, the unity of data will not be lost and this data can be easily used for further analysis. For such tasks we have created the S#.Data (Hydra) program (to read the instruction manual and have a look at examples of use here). This is a free program available for download. Hydra provides a variety of functions, but its main task is to download and store the data. hydra_new.png Hydra supports downloading not only candles of any timeframe, but also ticks, order log, level 1, order books on a variety of instruments. The program can not only download but also store the data incoming from the broker, for example from OEC Trader, Sterling, etc. Hydra stores data in the CSV or BIN formats (super compact storage format – 7 bytes per 1 order book image or 2 bytes per tick). The data are located locally, like files, and they can be accessed from any programming language, that eventually allows the user to store and use a vast array of market data on a home computer, a server or in the cloud (AWS supported). Summing up the article, we hope that the techniques outlined in it will allow you to get the market data for adequate means and become a bit closer to the professional participants. They have long been doing just that. Good luck on the market!