Skip to content
Wildflower
Join free
The strategy library

Free Trading School · Level 3 · Course 3.2

Test it yourself: moving average crossover

Lesson 16 of 179 in The strategy libraryModule 3: Moving average crossover

Strategies · The strategy library

Test it yourself: moving average crossover

Wildflower Trading School · Lesson 3.2.3.5

Wildflower

In this test, you'll run two settings of the same crossover over the same days and compare them. By the end of this lesson, you'll know how to add two averages on TradingView, and step through a day logging every trade. Then you'll change the setting, replay the same day, and compare trade counts, losing runs and costs.

1 of 9

What you'll learn

  • Set up two versions. Run 9 and 21 exponential averages, then 20 and 50, on the same days.
  • Add the averages in TradingView. Add the EMA twice and set the second length to 21.
  • Log every trade. Keep a separate sheet for each setting.
  • Compare the two sheets. Look at trade counts, costs and the most losses in a row.

Exercise

  1. Pick 10 days in a row and replay each on a 5-minute MES1! chart, on TradingView or any other platform, once with a 9 and 21 EMA and once with a 20 and 50.
  2. Log every trade, then compare trade counts, longest losing runs and costs.

Next: Momentum and bar up, bar down.

Quick check

  1. 1. Why run both settings on the same days?

  2. 2. TradingView's Moving Average Exponential starts at which length?

  3. 3. Trades: W L L L W L L W. Longest losing run?

0 of 3 answered.

Finished this lesson?

Tick it off and keep your place

Make a free account and we'll remember where you are, so “Momentum and bar up, bar down” is waiting next time.

Read the full notes

To test a crossover yourself, replay the same days with two settings, log every trade on separate sheets, and compare trade counts, the longest losing run and costs.

  • This test runs two settings of one over the same days. Write it down first: MES1!, 5-minute , New York time, 9:30 am to 4:00 pm; setting A is a 9 and 21 , setting B a 20 and 50; enter on the close, a one beyond the last swing, exit on the opposite cross; 10 days in a row, chosen before you look.
  • On TradingView: click Indicators, search for Moving Average Exponential and add it twice. Its default length is 9; open the second one's settings with the gear and set Length to 21. See Adding an indicator in TradingView. Then click Replay, use Select bar and Select date in the replay bar to go to your first day, and step on with Forward (). What you can replay depends on your plan; other platforms have similar tools.
  • Log every trade: time, direction, entry, stop, exit and points. Then change the lengths to 20 and 50 and replay the same days on a separate sheet.
  • Compare trade counts, the longest and costs (; an example $2 a trade). With W L L W L L L L W L, the longest losing run is 4. Ten days is a small : a first look, not a verdict. See Testing an indicator idea yourself and Slippage and commissions in a backtest.

Worked example

Made-up numbers

Find the longest losing run

Made-up trades, in order · W L L W L L L L W L

  1. Runs of losses: 2, 4, 1

The longest losing run is 4.

Your turn

Drill

Made-up trades, in order · L W L L L W W L L W

Trading is risky. You can lose money. This lesson explains how a strategy is built and tested. It isn't advice, and it doesn't say the strategy works.