답변완료
수식변환
항상 수고 많으십니다.
트레이딩뷰에 있는 수식을 이용할수있도록 도움받고자 글 남깁니다.
변환 부탁드립니다.
************
study(title="CCI Divergences", format=format.price)
len = input(title="CCI Period", minval=1, defval=14)
src = input(title="CCI Source", defval=close)
lbR = input(title="Pivot Lookback Right", defval=5)
lbL = input(title="Pivot Lookback Left", defval=5)
rangeUpper = input(title="Max of Lookback Range", defval=60)
rangeLower = input(title="Min of Lookback Range", defval=5)
plotBull = input(title="Plot Bullish", defval=true)
plotHiddenBull = input(title="Plot Hidden Bullish", defval=false)
plotBear = input(title="Plot Bearish", defval=true)
plotHiddenBear = input(title="Plot Hidden Bearish", defval=false)
bearColor = color.red
bullColor = color.green
hiddenBullColor = color.green
hiddenBearColor = color.red
textColor = color.white
noneColor = color.new(color.white, 100)
osc = cci(src, len)
plot(osc, title="CCI", linewidth=2, color=color.yellow)
obLevel = hline(100, title="Overbought", linestyle=hline.style_dotted)
osLevel = hline(-100, title="Oversold", linestyle=hline.style_dotted)
fill(obLevel, osLevel, title="Background", color=color.gray, transp=80)
plFound = na(pivotlow(osc, lbL, lbR)) ? false : true
phFound = na(pivothigh(osc, lbL, lbR)) ? false : true
_inRange(cond) =>
bars = barssince(cond == true)
rangeLower <= bars and bars <= rangeUpper
alertcondition(osc[1] > 100.0 and osc[2] < 100.0, title="CCI value crosses over 100.0", message="Check charts for a CCI cross over 100.0")
alertcondition(osc[1] < 100.0 and osc[2] > 100.0, title="CCI value crosses under 100.0", message="Check charts for a CCI cross under 100.0")
alertcondition(osc[1] > -100. and osc[2] < -100.0, title="CCI value crosses over -100.0", message="Check charts for a CCI cross over -100.0")
alertcondition(osc[1] < -100.0 and osc[2] > -100.0, title="CCI value crosses under -100.0", message="Check charts for a CCI cross under -100.0")
//------------------------------------------------------------------------------
// Regular Bullish
// Osc: Higher Low
oscHL = osc[lbR] > valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])
// Price: Lower Low
priceLL = low[lbR] < valuewhen(plFound, low[lbR], 1)
bullCond = plotBull and priceLL and oscHL and plFound
plot(
plFound ? osc[lbR] : na,
offset=-lbR,
title="Regular Bullish",
linewidth=2,
color=(bullCond ? bullColor : noneColor),
transp=0
)
plotshape(
bullCond ? osc[lbR] : na,
offset=-lbR,
title="Regular Bullish Label",
text=" Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor,
transp=0
)
alertcondition(bullCond, title="Regular bullish divergence in CCI found", message="Check charts for a regular bullish divergence found with CCI")
//------------------------------------------------------------------------------
// Hidden Bullish
// Osc: Lower Low
oscLL = osc[lbR] < valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])
// Price: Higher Low
priceHL = low[lbR] > valuewhen(plFound, low[lbR], 1)
hiddenBullCond = plotHiddenBull and priceHL and oscLL and plFound
plot(
plFound ? osc[lbR] : na,
offset=-lbR,
title="Hidden Bullish",
linewidth=2,
color=(hiddenBullCond ? hiddenBullColor : noneColor),
transp=0
)
plotshape(
hiddenBullCond ? osc[lbR] : na,
offset=-lbR,
title="Hidden Bullish Label",
text=" H Bull ",
style=shape.labelup,
location=location.absolute,
color=bullColor,
textcolor=textColor,
transp=0
)
alertcondition(hiddenBullCond, title="Hidden bullish divergence in CCI found", message="Check charts for a hidden bullish divergence found with CCI")
//------------------------------------------------------------------------------
// Regular Bearish
// Osc: Lower High
oscLH = osc[lbR] < valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])
// Price: Higher High
priceHH = high[lbR] > valuewhen(phFound, high[lbR], 1)
bearCond = plotBear and priceHH and oscLH and phFound
plot(
phFound ? osc[lbR] : na,
offset=-lbR,
title="Regular Bearish",
linewidth=2,
color=(bearCond ? bearColor : noneColor),
transp=0
)
plotshape(
bearCond ? osc[lbR] : na,
offset=-lbR,
title="Regular Bearish Label",
text=" Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor,
transp=0
)
alertcondition(bearCond, title="Regular bearish divergence in CCI found", message="Check charts for a regular bearish divergence found with CCI")
//------------------------------------------------------------------------------
// Hidden Bearish
// Osc: Higher High
oscHH = osc[lbR] > valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])
// Price: Lower High
priceLH = high[lbR] < valuewhen(phFound, high[lbR], 1)
hiddenBearCond = plotHiddenBear and priceLH and oscHH and phFound
plot(
phFound ? osc[lbR] : na,
offset=-lbR,
title="Hidden Bearish",
linewidth=2,
color=(hiddenBearCond ? hiddenBearColor : noneColor),
transp=0
)
plotshape(
hiddenBearCond ? osc[lbR] : na,
offset=-lbR,
title="Hidden Bearish Label",
text=" H Bear ",
style=shape.labeldown,
location=location.absolute,
color=bearColor,
textcolor=textColor,
transp=0
)
alertcondition(hiddenBearCond, title="Hidden bearish divergence in CCI found", message="Check charts for a hidden bearish divergence found with CCI")
2025-03-07
441
글번호 188892
지표
답변완료
수식요청
다=Min(
NPreDayLow(2),NPreDayLow(3),NPreDayLow(4),
NPreDayLow(5),NPreDayLow(6),NPreDayLow(7),
NPreDayLow(8),NPreDayLow(9),NPreDayLow(10),
NPreDayLow(11),NPreDayLow(12),NPreDayLow(13),
NPreDayLow(14),NPreDayLow(15),NPreDayLow(16));
바=Max(
NPreDayHigh(1),NPreDayHigh(2),NPreDayHigh(3),
NPreDayHigh(4),NPreDayHigh(5),NPreDayHigh(6),
NPreDayHigh(7),NPreDayHigh(8),NPreDayHigh(9),
NPreDayHigh(10),NPreDayHigh(11),NPreDayHigh(12),
NPreDayHigh(13),NPreDayHigh(14),NPreDayHigh(15));
스=CountSince(DayLow()<다,date!=date(1))==(기간-간격);
Valuewhen(1,스,바)
기간 15, 간격 3
위 수식은 60분봉에서 다바스박스 선을 긋는 것으로 입수한 것입니다.
이 선을 돌파하는 종목을 검색코저 합니다만,
우선 이 수식이 맞는 건지 아니면 다른 더 좋은 게 있는지요?
60분봉 돌파수식을 부탁드립니다.
(물론 예스랭귀지로 된 수식)
2025-03-09
362
글번호 188884
종목검색