soru

MAcross tracker

12
Please test it :)
สคริปต์โอเพนซอร์ซ

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

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

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

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?
study("MAcross tracker",overlay=true)
k = ismonthly ? 'M' : isweekly ? 'W' : isdaily ? 'D' : ''
ma_len = input(200)
TW1=input('240')
TW2=input('1D')
TW3=input('1W')
TW4=input('1M')
Ins1 = input("FX:USDCAD")
Ins2 = input("FX:AUDUSD")
Ins3 = input("FX:EURUSD")
Ins4 = input("FX:GBPUSD")
signal(x,y)=>
    ma = security(y,x, sma(close,ma_len))
    c = security(y,x, close)
    s = cross(ma,c) ? cross(ma,c) : na
    [s]

[s1_TW1] = signal(TW1,Ins1)
[s1_TW2] = signal(TW2,Ins1)
[s1_TW3] = signal(TW3,Ins1)
[s1_TW4] = signal(TW4,Ins1)
[s2_TW1] = signal(TW1,Ins2)
[s2_TW2] = signal(TW2,Ins2)
[s2_TW3] = signal(TW3,Ins2)
[s2_TW4] = signal(TW4,Ins2)
[s3_TW1] = signal(TW1,Ins3)
[s3_TW2] = signal(TW2,Ins3)
[s3_TW3] = signal(TW3,Ins3)
[s3_TW4] = signal(TW4,Ins3)
[s4_TW1] = signal(TW1,Ins4)
[s4_TW2] = signal(TW2,Ins4)
[s4_TW3] = signal(TW3,Ins4)
[s4_TW4] = signal(TW4,Ins4)
hline(1,color=black,linewidth=2)
plotshape(s1_TW1 ? 1 : na,style=shape.labeldown,color=#006600, textcolor=black,text='4h', location=location.absolute)
plotshape(s1_TW2 ? 1 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1D', location=location.absolute)
plotshape(s1_TW3 ? 1 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1W', location=location.absolute)
plotshape(s1_TW4 ? 1 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1M', location=location.absolute)
hline(2,color=black,linewidth=2)
plotshape(s2_TW1 ? 2 : na,style=shape.labeldown,color=#006600, textcolor=black,text='4h', location=location.absolute)
plotshape(s2_TW2 ? 2 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1D', location=location.absolute)
plotshape(s2_TW3 ? 2 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1W', location=location.absolute)
plotshape(s2_TW4 ? 2 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1M', location=location.absolute)
hline(3,color=black,linewidth=2)
plotshape(s3_TW1 ? 3 : na,style=shape.labeldown,color=#006600, textcolor=black,text='4h', location=location.absolute)
plotshape(s3_TW2 ? 3 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1D', location=location.absolute)
plotshape(s3_TW3 ? 3 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1W', location=location.absolute)
plotshape(s3_TW4 ? 3 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1M', location=location.absolute)
hline(4,color=black,linewidth=2)
plotshape(s4_TW1 ? 4 : na,style=shape.labeldown,color=#006600, textcolor=black,text='4h', location=location.absolute)
plotshape(s4_TW2 ? 4 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1D', location=location.absolute)
plotshape(s4_TW3 ? 4 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1W', location=location.absolute)
plotshape(s4_TW4 ? 4 : na,style=shape.labeldown,color=#006600, textcolor=black,text='1M', location=location.absolute)
bgcolor(n>n[1] ? blue : gray)