Page 1 of 1

Moving Average Crossover

Posted: Tue Jan 10, 2012 3:33 pm
by zztopband
Looking for a simple M.A. crossover scan (ie 10sma crosses 22ema) that is able to tell me 2 things:
1. How many days ago was the last crossover and 2. able to click in your spread sheet, starting from 0 (today crossover) on up.

Re: Moving Average Crossover

Posted: Tue Jan 17, 2012 1:40 pm
by Chris White
You can use the built-in scan called 'MAU' (moving average crossing up) as a starting point for this. MAU uses two simple moving averages but it is easy to copy that script and modify the second moving average to be an exponential moving average like so:

Code: Select all

Event:Cross(MA(C, FastPeriod),EMA(C,SlowPeriod));
Once this scan is in place you can add it to the 'Entries and Exits' scanner to generate a spreadsheet of all occurrences of the signals for any given list of stocks:
Spreadsheet showing all signals for this scan
Spreadsheet showing all signals for this scan
smacrossema_grid.png (42.14 KiB) Viewed 16362 times
You can also add the script to a chart layout so that when you click on the signals in the spreadsheet and see a chart you have a visual reference for the current signal and all previous signals:
Chart with scan added to a chart area
Chart with scan added to a chart area
smacrossema_chart.png (59.04 KiB) Viewed 16362 times
Give it a whirl!

Chris White
CEO, EdgeRater LLC