답변완료
부탁드립니다.
적용가능하도록 변형 부탁 드립니다.
indicator("Purple Cloud [MMD]",overlay=true, timeframe="", timeframe_gaps=true)
x1 = input(21, "Period")
alpha = input.float(1, "Alpha", step = 0.1)
mmdband=input(true,'MMD Bands')
x2 = ta.atr(x1) * alpha
xh = close + x2
xl = close - x2
a1=ta.vwma(hl2*volume,math.ceil(x1/4))/ta.vwma(volume,math.ceil(x1/4))
a2=ta.vwma(hl2*volume,math.ceil(x1/2))/ta.vwma(volume,math.ceil(x1/2))
a3=2*a1-a2
a4=ta.vwma(a3,x1)
b1 = 0.0
b1 := na(b1[1]) ? ta.sma(close, x1) : (b1[1] * (x1 - 1) + close) / x1
buy = a4<=xl and close>b1
sell = a4>=xh and close<b1
xs = 0
xs := buy ? 1 : sell ? -1 : xs[1]
barcolor( color = xs==1 ? color.purple :xs==-1? color.orange:na)
plotshape(buy and xs != xs[1], title = "BUY", text = 'B', style = shape.labelup, location = location.belowbar, color= color.purple, textcolor = color.white, size = size.tiny)
plotshape(sell and xs != xs[1], title = "SELL", text = 'S', style = shape.labeldown, location = location.abovebar, color= color.orange, textcolor = color.white, size = size.tiny)
xx1 = if close < open
low
else
high
xx2 = if close[1] < open[1]
low[1]
else
high[1]
xx3 = if close[2] < open[2]
low[2]
else
high[2]
xx4 = if close[3] < open[3]
low[3]
else
high[3]
xx5 = if close[4] < open[4]
low[4]
else
high[4]
xx6 = if close[5] < open[5]
low[5]
else
high[5]
xx7 = if close[6] < open[6]
low[6]
else
high[6]
xx8 = if close[7] < open[7]
low[7]
else
high[7]
xx9 = if close[8] < open[8]
low[8]
else
high[8]
xx10 = if close[9] < open[9]
low[9]
else
high[9]
xx11 = if close[10] < open[10]
low[10]
else
high[10]
xx12 = if close[11] < open[11]
low[11]
else
high[11]
xx13 = if close[12] < open[12]
low[12]
else
high[12]
xx14 = if close[13] < open[13]
low[13]
else
high[13]
xx15 = if close[14] < open[14]
low[14]
else
high[14]
xx16 = if close[15] < open[15]
low[15]
else
high[15]
y1=(xx1+xx2+xx3+xx4+xx5+xx6+xx7+xx8+xx9+xx10+xx11+xx12+xx13+xx14+xx15+xx16)/16
aa=2*ta.ema(y1,2)-ta.ema(y1,4)
aa1=ta.highest(high,16)
aa2=ta.lowest(low,16)
aa3=(aa1-aa2)*0.618
plot(aa+aa3,color=mmdband?color.purple:na,transp=40)
plot(aa-aa3,color=mmdband?color.orange:na,transp=40)
plot(aa,color=mmdband?color.black:na,transp=40)
alertcondition(buy and xs != xs[1], "PC Long", "PC Long")
alertcondition(sell and xs != xs[1], "PC Short", "PC Short")
2023-09-18
1203
글번호 172559
지표
답변완료
안녕하세요^^ 문의드립니다
안녕하세요 ^^
▶ 아래식에서 조건추가 부탁드립니다
var : T(0),S(0),Tx(0);
if T <= 0 and C > O Then
{
T = 1;
S = C;
Tx = Text_New(sDate,sTime,C,NumToStr(C,2));
Text_SetStyle(tx,2,3);
}
if T >= 0 and C < O Then
{
T = -1;
S = C;
Tx = Text_New(sDate,sTime,C,NumToStr(C,2));
Text_SetStyle(tx,2,0);
}
Plot1(S,"종가");
▶조건 추가 부탁드립니다 ▶
▶위 식에 조건추가 ~
양봉종가는 단순이동평균선이 ( 5 이평선 > 20 이평선) 일때만 ~
나타나게 해주세요 (5 < 20)일때는 안나타난다
음봉종가는 단순이동평균선 ( 5 이평선 < 20 이평선) 일때만 ~
나타나게 해주세요 (5 > 20)일때는 안나타난다
♣ 감사합니다 ♣
2023-09-18
692
글번호 172530
검색