Types of Orders and Their Simulation in Python
In the previous chapter, we considered a number of classical trading strategies usually employed in FX trading. All of them can be automated – that is, the decision to place a trade can be made based on quantitative data only, and placing a trade in the market can be done by an algorithm. So, we need now to find a proper way to place trades and control their execution.
We already mentioned (see Chapter 1, Developing Trading Strategies – Why They Are Different) that any trade, manual or automated, can be placed in the market by using an order: an instruction to the broker (or any other intermediary) to buy or sell. What could be simpler? However, the reality is always more complex. You may want to trade at a certain price, no worse than a certain price, no more than a specified amount of pips (points) from a certain price, and so on. Besides that, in the real market, there is real liquidity, which is always very far from...