As we mentioned in the previous chapter, rules are made up of conditions. In this chapter, we create the conditions involved in the Long rule. Finally, we create the rule itself and the trading actions that this rule triggers when all the conditions that define the rule met.
- Long Condition 1: Is new bar equals true (A new bar just opens).
- Long Condition 2: Total buy orders open equals 0 (we only want one order open at a time).
- Long Condition 3: Fast MA in 2 less than Slow MA in 2
- Long Condtion 4: Fast MA in 1 minus Slow MA in 1 is greater than 5 pips.
- Long Action 1: Close Sell orders (if there is any).
- Long Action 2: Open a Buy order.