Moving Average crossover (using EMA)

This topic contains 0 replies, has 1 voice, and was last updated by Seer Seer 8 years ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #3911
    Seer
    Seer
    Keymaster

    The classic moving average system is probably the best known of all trading systems. Although it doesn’t work well (or at all) in modern markets, it’s still a good starting point for learning the basics. The example below has an interesting twist, in that rather going long on the cross over, it goes short. For forex on the major pairs, it has an impressive win ratio (over 70%) at the smaller time frames (such as 1, 5 and 10 minute bars). That said, it has a low profit factor and the spread will have an effect on the overall system profitability.

    #Do we have a position?
    unless (Position) {
      #if the 14 bar EMA crosses over the 21 bar EMA
      if (Crossover(EMA(Close,14),EMA(Close,31))) {
        PlaceSellMarket('Go Short',10000);
      }
    }
    else {
      #if the 14 bar EMA crosses under the 21 bar EMA
      if (Crossunder(EMA(Close,14),EMA(Close,31))) {
        PlaceBuyMarket('Close short',10000);
      }
    }
    

    This system can be download as a SID (489), Clasic moving average system

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.