답변완료
추세선 관련해서 질문드립니다
매번 답변 주셔서 감사드립니다
추세선 관련 질문 3 가지가 있는데요,
1) 추세선을 작성하고 shift 이동이 가능한가요? 예를들면 5봉만큼 오른쪽으로 이동하는 식으로요
2) 추세선 만들기 공부를 하고 있는데 아래식이 어떤 조건을 나타내는건지 간단히 해석을 해주셨으면 감사하겠습니다
"현재봉 고가가 1봉전 고가 이하이고 h(1)이 h(2)보다 클때" 는 알겠는데 else 부터 추가 조건이 있나해서 여쭤봅니다.if문에서 t에 1을 대입하고 else에서는 t=0, t=2 로 나뉘는데 어떤 의미인지 궁금합니다. 그리고 else 부터는 if 조건의 역(?)조건을 의미라는건가요??
var : T(0),cnt(0),TL(0),HTL1(0),HTL2(0),LTL1(0),LTL2(0);
var : hd(0),ht(0),hh(0),ld(0),lt(0),ll(0);
Array : SHD[5](0),SHT[5](0),SHV[5](0);
Array : SLD[5](0),SLT[5](0),SLV[5](0);
var : SHL(0),SLH(0),S(0);
if h <= h[1] && h[1] > h[2] then
{
hd = sDate[1];
ht = sTime[1];
hh = H[1];
SHL = L[1];
T = 1;
}
Else
{
if T == 1 and h > hh then
T = 0;
if T == 1 and L < SHL Then
{
T = 2;
SHD[0] = hd;
SHT[0] = ht;
SHV[0] = hh;
if SLV[0] > 0 Then
{
S = 1;
if S[1] != 1 Then
{
TL = TL_New(SLD[0],SLT[0],SLV[0],SHD[0],SHT[0],SHV[0]);
TL_SetColor(TL,Red);
}
Else
TL_SetEnd(TL,SHD[0],SHT[0],SHV[0]);
}
}
}
// 저점은 반대
if T >= 0 and l >= l[1] && l[1] < l[2] then
{
ld = sDate[1];
lT = sTime[1];
ll = L[1];
SLH = H[1];
T = -1;
}
Else
{
if T == -1 and l < ll then
T = 0;
if T == -1 and h > SLH Then
{
T = -2;
SLD[0] = ld;
SLT[0] = lt;
SLV[0] = ll;
if SHV[0] > 0 Then
{
S = -1;
if S[1] != -1 Then
{
TL = TL_New(SHD[0],SHT[0],SHV[0],SLD[0],SLT[0],SLV[0]);
TL_SetColor(TL,Blue);
}
Else
TL_SetEnd(TL,SLD[0],SLT[0],SLV[0]);
}
}
}
3)추세선 작성 수식을 부탁드리겠습니다
1. n봉동안
2. h-l 의 길이가 4% 이상이고 전일 종가 대비 시가갭이 -3% 이상인 봉이 한개이상 있을때
3.그 기간동안 고점과 저점의 차이가 13% 이상 나면 nth 봉의 고점과
최근봉의 저점을 추세선으로 표시하고 "소요되는 봉의 갯수" (countif 를 쓰는건가요??~~) 를 구하고 싶습니다. (만약 5개 봉이 포착이 된다면 5번째 봉의 고점과 0번째 봉의 저점을 연결하는 추세선을 구하고 싶습니다)
감사합니다
2024-08-02
839
글번호 182184
지표
답변완료
지표 변환 부탁드립니다
매번 바쁘신데 감사드립니다.
QQE MOD 지표인데 multi time frame 버전입니다.
차트주기와 타주기 모두 표현 가능하고, 그래프가 첨부사진 위와 아래처럼 두 가지 모습 모두 가능한지 궁금합니다.
트레이딩뷰 지표인데 예스랭귀지로 변환 가능한지 문의드립니다.
indicator("SuperJump QQE MOD MTF", shorttitle = "Sjump QQE MOD MTF", timeframe="",timeframe_gaps =true)
RSI_Period = input.int(6, title='RSI Length')
SF = input.int(5, title='RSI Smoothing')
QQE = input.int(3, title='Fast QQE Factor')
ThreshHold = input.int(3, title="Threshold")
src = input.source(close, title="RSI Source")
QQELongColor = input.color(color.new(color.green,50), "QQE Long")
QQEShortColor = input.color(color.new(color.red,50), "QQE Short")
QQEWeakColor = input.color(color.new(color.gray,50), "QQE Weak")
isFillBackGround = input.bool(false,"Fill BackGround for higherTimeFrame")
GetQQEDefaultValue(_src, _rsi_period, _sf, _qqe) =>
_Wilders_Period = _rsi_period * 2 - 1
_RSI = ta.rsi(_src, _rsi_period)
_RsiMa = ta.ema(_RSI, _sf)
_AtrRsi = math.abs(_RsiMa[1] - _RsiMa)
_MaAtrRsi = ta.ema(_AtrRsi, _Wilders_Period)
_dar = ta.ema(_MaAtrRsi, _Wilders_Period) * _qqe
[_Wilders_Period, _RSI, _RsiMa, _AtrRsi, _dar]
[Wilders_Period, Rsi,RsiMa,AtrRsi,dar] = GetQQEDefaultValue(src, RSI_Period, SF, QQE)
GetFastAtrRsiTL(_dar, _RsiMa)=>
longband = 0.0
shortband = 0.0
trend = 0
DeltaFastAtrRsi = _dar
RSIndex = _RsiMa
newshortband = RSIndex + DeltaFastAtrRsi
newlongband = RSIndex - DeltaFastAtrRsi
longband := RSIndex[1] > longband[1] and RSIndex > longband[1] ? math.max(longband[1], newlongband) : newlongband
shortband := RSIndex[1] < shortband[1] and RSIndex < shortband[1] ? math.min(shortband[1], newshortband) : newshortband
cross_1 = ta.cross(longband[1], RSIndex)
trend := ta.cross(RSIndex, shortband[1]) ? 1 : cross_1 ? -1 : nz(trend[1], 1)
FastAtrRsiTL = trend == 1 ? longband : shortband
FastAtrRsiTL = GetFastAtrRsiTL(dar, RsiMa)
length = input.int(50, minval=1, title="Bollinger Length")
mult = input.float(0.35, minval=0.001, maxval=5, step=0.1, title="BB Multiplier")
basis = ta.sma(FastAtrRsiTL - 50, length)
dev = mult * ta.stdev(FastAtrRsiTL - 50, length)
upper = basis + dev
lower = basis - dev
Zero = hline(0, color=color.white, linestyle=hline.style_dotted, linewidth=1)
////////////////////////////////////////////////////////////////
RSI_Period2 = input(6, title='RSI Length')
SF2 = input(5, title='RSI Smoothing')
QQE2 = input(1.61, title='Fast QQE2 Factor')
ThresHold2 = input(3, title="Threshold")
src2 = input(close, title="RSI Source")
[Wilders_Period2, Rsi2,RsiMa2,AtrRsi2,dar2] = GetQQEDefaultValue(src2, RSI_Period2, SF2, QQE2)
FastAtrRsi2TL = GetFastAtrRsiTL(dar2, RsiMa2)
Greenbar1 = RsiMa2 - 50 > ThresHold2
Greenbar2 = RsiMa - 50 > upper
Redbar1 = RsiMa2 - 50 < 0 - ThresHold2
Redbar2 = RsiMa - 50 < lower
isLongTrend = Greenbar1 and Greenbar2 == 1
isShortTrend = Redbar1 and Redbar2 == 1
plot(isFillBackGround == false? FastAtrRsi2TL - 50:na , title='QQE Line', color=color.white, transp=0, linewidth=2)
plot(isFillBackGround == false ? RsiMa2 - 50 :na , title="QQE Area", style=plot.style_area, color= isLongTrend ? QQELongColor : isShortTrend ? QQEShortColor : QQEWeakColor)
isLongSignal = FastAtrRsi2TL - 50 >=0 and ta.crossunder(RsiMa2 - 50,FastAtrRsi2TL - 50) and isFillBackGround == false
isShortSignal = FastAtrRsi2TL - 50 <0 and ta.crossover(RsiMa2 - 50,FastAtrRsi2TL - 50) and isFillBackGround == false
감사합니다!
2024-08-01
1305
글번호 182178
지표