답변완료
부탁 드립니다.
도움에 늘 깊이 감사 드립니다.
원본수식을 타주기(분봉용)으로 작성 해본 것입니다.
그러나 미숙한 지식탓에 어딘가에 정상적이지 않아 보여
수정 부탁 드리고자 합니다.
미리 경배로 감사 인사 올립니다.
원본수식).
Inputs : Period(60),sig(5);
Vars: Noise(0), Signal(0), Diff(0), efRatio(0),
Smooth(1), Fastest(0.6667), Slowest(0.0645), AdaptMA(0);
Diff = AbsValue(c - c[1]);
IF CurrentBar <= Period Then
AdaptMA = c;
IF CurrentBar > Period Then Begin
Signal = AbsValue(c - c[Period]);
Noise = accumN(Diff, Period);
efRatio = Signal / Noise;
Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2);
AdaptMA = AdaptMA[1] + Smooth * (c - AdaptMA[1]);
End;
var1=c-adaptma;
var2=ma(var1,sig);
*타주기(분봉용) 수식
input : ntime(30),Period(60),sig(5);
Vars: Noise(0), Signal(0), Diff(0), efRatio(0),
Smooth(1), Fastest(0.6667), Slowest(0.0645), AdaptMA(0);
var : S1(0),D1(0),TM(0),TF(0),cnt(0),sum(0),mav(0);
Array : C1[100](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99
{
C1[cnt] = C1[cnt-1][1];
}
}
C1[0] = C;
Diff = AbsValue(C1[0] - c1[1]);
IF CurrentBar <= Period Then
AdaptMA = C1[0];
IF CurrentBar > Period Then Begin
Signal = AbsValue(C1[0] - c1[Period]);
Noise = accumN(Diff, Period);
efRatio = Signal / Noise;
Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2);
AdaptMA = AdaptMA[1] + Smooth * (C1[0] - AdaptMA[1]);
End;
var1=C1[0]-adaptma;
var2=ma(var1,sig);}
2020-10-06
678
글번호 142903
지표
답변완료
지표식 부탁드립니다.
다음 수식을 지표전환부탁드립니다.
수식1
t2=tema(c,period);
if(c>t2,max(c,o),0)
수식2
t2=tema(c,period);
if(c<t2,max(c,o),0)
수식3
t1=tema(c,20);
t2=tema(c,period);
if((low<t2 && high>t2) or (t1>t2 && high<t2),max(c,o),min(c,o))
수식4
t1=tema(c,20);
t2=tema(c,period);
z=if((t1<t2 && high>t2 && low<t2) or (t1<t2 && low>t2),max(c,o),
if(t1<t2 && high<t2,min(c,o),0))
period 10
2020-10-06
684
글번호 142902
지표
답변완료
문의드립니다.
아래수식을 예스로 변환부탁합니다.
어려운부분을 부탁드려 죄송합니다.
시스템신호만 부탁드립니다.
periods = input(5, "Relevant Periods to identify OB")
threshold = input(0.0, "Min. Percent move to identify OB", step = 0.1)
usewicks = input(false, "Use whole range [High/Low] for OB marking?" )
showbull = input(true, "Show latest Bullish Channel?")
showbear = input(true, "Show latest Bearish Channel?")
showdocu = input(true, "Show Label for documentation tooltip?")
ob_period = periods + 1
absmove = ((abs(close[ob_period] - close[1]))/close[ob_period]) * 100
relmove = absmove >= threshold
bullishOB = close[ob_period] < open[ob_period]
int upcandles = 0
for i = 1 to periods
upcandles := upcandles + (close[i] > open[i]? 1 : 0)
OB_bull = bullishOB and (upcandles == (periods)) and relmove
OB_bull_high = OB_bull? usewicks? high[ob_period] : open[ob_period] : na
OB_bull_low = OB_bull? low[ob_period] : na
OB_bull_avg = (OB_bull_high + OB_bull_low)/2
bearishOB = close[ob_period] > open[ob_period]
int downcandles = 0
for i = 1 to periods
downcandles := downcandles + (close[i] < open[i]? 1 : 0)
OB_bear = bearishOB and (downcandles == (periods)) and relmove
OB_bear_high = OB_bear? high[ob_period] : na
OB_bear_low = OB_bear? usewicks? low[ob_period] : open[ob_period] : na
OB_bear_avg = (OB_bear_low + OB_bear_high)/2
plotshape(OB_bull, title="Bullish OB", style = shape.triangleup, color = color.white, size = size.tiny, location = location.belowbar, offset = -ob_period, text = "Bullish OB")
bull1 = plot(OB_bull_high, title="Bullish OB open", style = plot.style_linebr, color = color.white, offset = -ob_period, linewidth = 3)
bull2 = plot(OB_bull_low, title="Bullish OB low", style = plot.style_linebr, color = color.white, offset = -ob_period, linewidth = 3)
fill(bull1, bull2, color=color.white, transp = 0, title = "Bullish OB fill")
plotshape(OB_bull_avg, title="Bullish OB Average", style = shape.cross, color = color.white, size = size.normal, location = location.absolute, offset = -ob_period)
plotshape(OB_bear, title="Bearish OB", style = shape.triangledown, color = color.blue, size = size.tiny, location = location.abovebar, offset = -ob_period, text = "Bearish OB")
bear1 = plot(OB_bear_low, title="Bearish OB open", style = plot.style_linebr, color = color.blue, offset = -ob_period, linewidth = 3)
bear2 = plot(OB_bear_high, title="Bearish OB high", style = plot.style_linebr, color = color.blue, offset = -ob_period, linewidth = 3)
fill(bear1, bear2, color=color.blue, transp = 0, title = "Bearish OB fill")
plotshape(OB_bear_avg, title="Bearish OB Average", style = shape.cross, color = color.blue, size = size.normal, location = location.absolute, offset = -ob_period)
var line linebull1 = na // Bullish OB average
var line linebull2 = na // Bullish OB open
var line linebull3 = na // Bullish OB low
var line linebear1 = na // Bearish OB average
var line linebear2 = na // Bearish OB high
var line linebear3 = na // Bearish OB open
if OB_bull and showbull
line.delete(linebull1)
linebull1 := line.new(x1 = bar_index, y1 = OB_bull_avg, x2 = bar_index - 1, y2 = OB_bull_avg, extend = extend.left, color = color.white, style = line.style_solid, width = 1)
line.delete(linebull2)
linebull2 := line.new(x1 = bar_index, y1 = OB_bull_high, x2 = bar_index - 1, y2 = OB_bull_high, extend = extend.left, color = color.white, style = line.style_dashed, width = 1)
line.delete(linebull3)
linebull3 := line.new(x1 = bar_index, y1 = OB_bull_low, x2 = bar_index - 1, y2 = OB_bull_low, extend = extend.left, color = color.white, style = line.style_dashed, width = 1)
if OB_bear and showbear
line.delete(linebear1)
linebear1 := line.new(x1 = bar_index, y1 = OB_bear_avg, x2 = bar_index - 1, y2 = OB_bear_avg, extend = extend.left, color = color.blue, style = line.style_solid, width = 1)
line.delete(linebear2)
linebear2 := line.new(x1 = bar_index, y1 = OB_bear_high, x2 = bar_index - 1, y2 = OB_bear_high, extend = extend.left, color = color.blue, style = line.style_dashed, width = 1)
line.delete(linebear3)
linebear3 := line.new(x1 = bar_index, y1 = OB_bear_low, x2 = bar_index - 1, y2 = OB_bear_low, extend = extend.left, color = color.blue, style = line.style_dashed, width = 1)
chper = time - time[1]
chper := change(chper) > 0 ? chper[1] : chper
2020-10-06
725
글번호 142891
시스템