A trading system based upon three moving averages (Triple Crossover)

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

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

    The triple moving average crossover – the 4-9-18-day method was popularized by R. C. Allen in his book How to Build a Fortune in Commodities released in 1972.

    Rules:
    There are many variations of this basic system; this system goes long when the 9 bar EMA crosses over the 18 bar EMA. The system exits when the 4 bar EMA crosses under the 9 bar EMA.

     

    #Bring in the EMA columns into variables
    #Makes it easier to play with the values when we use the optimizer
    my $small   =EMA(Close,4);
    my $middle  =EMA(Close,9);
    my $large   =EMA(Close,18);
    
    unless (Position) {
      #we have no position, do entry rules
      BuyOpen if Crossover($middle,$large);
    }
    else {
      #we have a position, do exit rules
      SellOpen if Crossunder($small,$middle);
    }
    • This topic was modified 7 years, 8 months ago by  jez.
    • This topic was modified 7 years, 8 months ago by Seer Seer.
    • This topic was modified 7 years, 8 months ago by Seer Seer.
    • This topic was modified 7 years, 6 months ago by Seer Seer.
    • This topic was modified 7 years, 6 months ago by Seer Seer.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.