Types of Orders and Their Simulation in Python

In the previous lesson, 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 Lesson 1Developing 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 infinite, so you may have your orders rejected, filled partially, or executed at the wrong prices, and many more unexpected and undesired things may happen if you are not prepared.

Now, it’s time we learn about the main types of orders typically supported by most FX liquidity pools, consider the difference in execution depending on the order type, understand the choice of order types depending on the goal, and get prepared to outline the architecture of an order simulation engine, which imitates possible execution issues and, along with the trade logic, helps you test and improve your strategy to fit the real-life conditions before putting real money at stake.

In this lesson, we will cover the following topics:

  • Order ticket – what you send is what you get
  • Market orders – the way to get maximum control over transactional risk
  • Limit orders – guaranteed price, but not execution
  • Time in force – better control over execution
  • Stop orders – maximum uncontrolled risk
  • Compound orders

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *