HPotter

EMA & MA Crossover

จำนวนเข้าชม 42433
2961
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 .
สคริปต์โอเพนซอร์ซ

จากใจ TradingView ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ยินดีด้วย! คุณสามารถใช้มันได้ฟรี แต่การใช้โค๊ดนี้ซ้ำเพื่อการเผยเเพร่ อยู่ภายใต้ กฎของเรา คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้กับชาร์ตได้

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
////////////////////////////////////////////////////////////
//  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")
Donate BTC: 13fXLkhWuGMXRmcvwkG2gaWKcnsiD88bwE
USDT (TRC20): TH29EEXa19vfwZNYvxdUuMxoFY5QDYLcWG

ความคิดเห็น

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?
+56 ตอบกลับ
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?
+11 ตอบกลับ
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.

+20 ตอบกลับ
@HPotter, hi
can u show meta4 setting as picture?
ตอบกลับ
I believe the best timeframe to look at a chart crossing is daily if not hourly as it is a 10 MA and 10 EMA?
+4 ตอบกลับ
Basically when EMA crosses MA to downside stock goes down and viceversa ? @HPotter
+2 ตอบกลับ
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 ตอบกลับ
HPotter jeffersonabreu
@jeffersonabreu, Hi, what are your steps?
+3 ตอบกลับ
This strategy is even better if you consider the volatility. Sometimes, MA leads the price ;)
+1 ตอบกลับ