CapnOscar

Bouncer Moving Average V2

There you go lol
סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יכולים להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אך שימוש חוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.

רוצה להשתמש בסקריפ זה בגרף?
study(title="Bouncer Moving Average", shorttitle="BMA", overlay=true)

outh = sma(high, 200)
outl = sma(low, 200)
outc = sma(close, 200)


limadx = input(18, minval=1, title="ADX MA Active")
len = input(34, minval=1, title="Period")

up = change(high)
down = -change(low)
trur = rma(tr, 14)
plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, 14) / trur)
minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, 14) / trur)
sum = plus + minus 
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), 14)

macol = adx > limadx and plus > minus ? green : adx > limadx and plus < minus ? red :black
smma34 = na(smma34[1]) ? sma(close, len) : (smma34[1] * (len - 1) + close) / len
smma12 = na(smma12[1]) ? sma(close, 12) : (smma12[1] * (12 - 1) + close) / 12

plot(smma34, color=macol, transp=0)
plot(smma12, color=silver, transp=0)

ccol = smma12 > smma34 and rising(smma12,1) ? green : smma12 < smma34 and falling(smma12,1) ? red : black
plot(outh, color=ccol, transp=0)
plot(outl, color=ccol, transp=0)
plot(outc, color=ccol, transp=0, linewidth=2)