HPotter

EMA & MA Crossover

The Moving Average Crossover trading strategy is possibly the most popular
trading strategy in the world of trading. First of them were written in the
middle of XX century, when commodities trading strategies became popular.
This strategy is a good example of so-called traditional strategies.
Traditional strategies are always long or short. That means they are never
out of the market. The concept of having a strategy that is always long or
short may be scary, particularly in today’s market where you don’t know what
is going to happen as far as risk on any one market. But a lot of traders
believe that the concept is still valid, especially for those of traders who
do their own research or their own discretionary trading.
This version uses crossover of moving average and its exponential moving average .
Keluarkan daripada Skrip Pilihan Tambah kepada Skrip Pilihan
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 20/06/2014
// The Moving Average Crossover trading strategy is possibly the most popular
// trading strategy in the world of trading. First of them were written in the
// middle of XX century, when commodities trading strategies became popular.
// This strategy is a good example of so-called traditional strategies. 
// Traditional strategies are always long or short. That means they are never 
// out of the market. The concept of having a strategy that is always long or 
// short may be scary, particularly in today’s market where you don’t know what 
// is going to happen as far as risk on any one market. But a lot of traders 
// believe that the concept is still valid, especially for those of traders who 
// do their own research or their own discretionary trading. 
// This version uses crossover of moving average and its exponential moving average. 
////////////////////////////////////////////////////////////
study(title="EMA & MA Crossover", shorttitle="EMA & MA Crossover", overlay = true)
LengthMA = input(10, minval=1)
LengthEMA = input(10,minval=1)
xMA = sma(close, LengthMA)
xEMA = ema(xMA, LengthEMA)
pos = iff(xEMA < xMA , 1,
	    iff(xEMA > xMA, -1, nz(pos[1], 0))) 
barcolor(pos == -1 ? red: pos == 1 ? green : blue)
plot(xMA, color=red, title="MA")
plot(xEMA, color=blue, title="EMA")

Komen

Looks great - well done!
Now I want to use this to screen stocks that just did a crossover. How do I use this indicator script for screening in Tradingview?
+28 Balas
Hey mate, nice indicator. Works great. Just wondering how to add this indicator manually in MT4? Do I set one Simple MA and one Exponential MA at both 10?
+3 Balas
HPotter JimmyJambles
Hi, you should to use one sma 10 and then calculate Exponential MA 10 from sma 10, double smooting. And it will be same.

+12 Balas
Hey there I’m trying to add this indicator on my trading view page but it doesn’t come up on indicators. Can you please assist?
+1 Balas
HPotter jeffersonabreu
@jeffersonabreu, Hi, what are your steps?
+1 Balas
do you have that for mt5 ? cheers
thank you for your work
Balas
HPotter filipeaguiartrader
@filipeaguiartrader, No. Sorry.
+1 Balas
Why does this change the colour of the bars ?
Balas
HPotter adamcjohno18
@adamcjohno18, It recommended way - long or short signal. You can make comment this line: barcolor.... and change the color will fix.
Balas
Laman Utama Penyaring Saham Penyaring Forex Penyaring Kripto Kalendar Ekonomi Bagaimana ia berfungsi Ciri-ciri Carta Harga Rujuk rakan Peraturan Dalaman Pusat Bantuan Laman web dan Penyelesaian Broker Widget Penyelesaian Pencartaan Perpustakaan Pencartaan yang Ringan Blog & Berita Twitter
Profil Tetapan Profil Akaun dan Pengebilan Kawan-kawan yang dirujuk Coin Tiket Sokongan Saya Pusat Bantuan Idea yang diterbitkan Pengikut Mengikuti Mesej Peribadi Sembang Daftar Keluar