Craig_Claussen

MACD Multi-MA Strategy

Craig_Claussen ที่อัปเดต:   
This script applies the average of each major MA (SMA, RMA, EMA, WVMA, WMA) to the MACD formula.

The logic is simple. When all 5 MA's are in agreement in direction, then then script will notify users of change.
I posted this as a strategy to help show how logic does in back test. If you use my simple yet effective solution to find take profit locations, you can blow this back testing out of the water!!!


To set alerts simply turn script into study



//@version=2
study(title="MACD Multi-MA Study", overlay=false)

src = close
len1 = input(8, "FAST LOOKBACK")
len2 = input(144, "SLOW LOOKBACK")

/////////////////////////////////////////////
length = len2-len1
ma = vwma(src, length)
plot(ma, title="VWMA", color=lime)


length1 = len2-len1
ma1 = rma(src, length1)
plot(ma1, title="RMA", color=purple)

length2 = len2-len1
ma2 = sma(src, length2)
plot(ma2, title="SMA", color=red)


length3 = len2-len1
ma3 = wma(src, length3)
plot(ma3, title="WMA", color=orange)

length4 = len2-len1
ma4 = ema(src, length4)
plot(ma4, title="EMA", color=yellow)


long = ma > ma and ma1 > ma1 and ma2 > ma2 and ma3 > ma3 and ma4 > ma4
short = ma < ma and ma1 < ma1 and ma2 < ma2 and ma3 < ma3 and ma4 < ma4

alertcondition(long == true, title='MACD LONG SIGNAL', message='MACD LONG!')
alertcondition(short == true, title='MACD SHORT SIGNAL', message='MACD SHORT!')

เอกสารเผยแพร่:
Sorry for the confusion. I stumbled upon good results thinking I was using MACD formula. Turns out I was only using partial formula.

The mistake just goes to show how uncomplicated a script needs to be to give good back testing results even on a line chart.
เอกสารเผยแพร่:
Updated version with 4H setting at 66 just to show better backtest. See comment section below to test other lookback periods for other timeframes

I also changed overlay to true to save space on your screen

สคริปต์โอเพนซอร์ซ

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

คำจำกัดสิทธิ์ความรับผิดชอบ

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

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?