답변완료
추세선 반등
input : Period(17),선두께(1);
Var:상승색(Red), 하락색(Blue);
Var:j(0),T(0);
Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
Array:r[7](0),fr[7](0),TL2[7](0),TL3[7](0),TX2[7](0),TX3[7](0);
Plot1(0);
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) Then
T = -1;
If T == -1 Then
{
If T[1] != -1 Then
{
For j = 18 DownTo 0
{
LoVal[j+1] = LoVal[j];
LoBar[j+1] = LoBar[j];
}
LoVal[0] = L;
LoBar[0] = 0;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,하락색);
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
for j = 0 to 6
{
fr[j] = LoVal[1] + ((HiVal[0] - LoVal[1]) * r[j]);
}
}
If LoVal[0] > L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date22 = date[0];
time22 = stime[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
}
HiVal[0] = H;
HiBar[0] = 0;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,상승색);
TL9 = TL_New(sDate,sTime,0,sDate,sTime,99999);
TL_SetColor(TL9,Red);
TL_SetSize(TL9,0.5);
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
for j = 0 to 5
{
fr[j] = LoVal[0] + ((HiVal[1] - LoVal[0]) * r[j]);
}
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date32 = date[0];
time32 = stime[0];
TL_Delete(tl);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
}
}
TL_SetSize(TL1,선두께);
하락 추세선의 크기가 0.5p에 도달했을 때부터 끝날 때까지, 추세 내의 최저가에서 0.15p(3틱) 반등하면 첫 도달 봉에 동그라미 표시.
3틱 반등 첫 봉 하나가 5틱 정도까지 급등하여 장대봉이면 표시, 첫 3틱 도달봉 다음 3틱 이상 봉은 무표시. 즉 반등 3틱 도달 첫 봉에 크기 무관하게 동그라미 표시.
동그라미 표시 이후에 양전환되면 종료되나,양전환 안되고 반등나온 첫 저점이 깨지며 계속 하락하면 계속 최저가를 체크하다 다시 0.15p 반등나오면 그 첫 봉에 또 동그라미 표시(양전환 될때까지 최저가 체크). 삼선전환도 양전환시를 응용해봄.감사합니다.
2023-01-15
1048
글번호 165420
지표
답변완료
부탁 드립니다
항시노고에 감사드리며
다음식에서
1. RED와BLUE에 챠트에 표시선을 세로선과삼각표시로띄우고싶고
2. 강조식은 챠트표시대로 캔들에을구하고싶습니다
짜집기를하다하다 안되서
3 시스템식 부탁드립니다
노고에 깊은감사 드립니다
input : pd(22), bbl(20), mult(2.0), lb(50), ph(0.85), pl(1.01);
var : wvf(0),sDev(0),midLine(0), upperBand(0), rangeHigh(0),color(0), OverSold(0);
var : wvf_inv(0), sDev2(0),midLine2(0), upperBand2(0), rangeHigh2(0),color2(0), Overbought(0);
wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100;
wvf_inv = ((high-lowest(close, pd))/lowest(close, pd))*100;
sDev = mult * std(wvf, bbl);
midLine = ma(wvf, bbl);
upperBand = midLine + sDev;
rangeHigh = (highest(wvf, lb)) * ph;
sDev2 = mult * std(wvf_inv, bbl);
midLine2 = ma(wvf_inv, bbl);
upperBand2 = midLine2 + sDev2;
rangeHigh2 = (highest(wvf_inv, lb)) * ph;
if wvf >= upperBand or wvf >= rangeHigh Then
OverSold = 1;
Else
OverSold = 0;
color = iff(OverSold == 1, RGB(000,255,000), RGB(128,128,128));
if CountIF(OverSold[1] > 0 ,4) == 4 and OverSold == 0 Then
color = RED;
if wvf_inv >= upperBand2 or wvf_inv >= rangeHigh2 Then
Overbought = 1;
Else
Overbought = 0;
color2 = iff(Overbought == 1, RGB(255,102,0), GRAY);
if CountIF(Overbought[1] > 0 ,4) == 4 and Overbought == 0 Then
color2 = BLUE;
Plot1(-wvf,"wvf",color);
plot2(wvf_inv,"wvf_inv",color2);
2023-01-15
868
글번호 165419
지표
답변완료
신호부탁드립니다
m10=ma(c,10,지수);
m20=ma(c,20,지수);
;
m60=ma(c,60,지수);
m240=ma(c,240,지수);
a5=(highest(H,8) - C)
/
(highest(H, 8) - lowest(L, 8))
* (-100);
aa= crossdown(a5,-80);
bb= crossup(a5,-75);
cc=countsince(aa,bb)==1 && m10>m25 && M240<l && m20<l && m20>m60 && b>0;
cc && !cc(1);
2023-01-15
629
글번호 165418
시스템
답변완료
수식 변환 문의
수고 하십니다.
아래 식 변환 요청 드립니다.
수고 하세요...
[Pivot Order Block Boxes]
##############
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// ⓒ lmatl
//@version=5
indicator('Pivot order block boxes [LM]', overlay=true, max_bars_back=500, max_boxes_count=500)
i_firstShowPivotBoxes = input.bool(true, 'Show first boxes', group='first pivot setting')
i_firstLeft = input.int(20, 'Left', group='first pivot setting')
i_firstRight = input.int(10, 'Right', group='first pivot setting')
i_firstBoxCount = input.int(5, title='Box count', group='first pivot setting')
i_firstPercentageChange = input.int(10, title='Percentage change on the right side of pivot', group='first pivot setting')
i_firstPivotHighColor = input.color(color.green, title='Pivot high color', group='first pivot setting')
i_firstPivotLowColor = input.color(color.red, title='Pivot low color', group='first pivot setting')
firstBoxHighColor = color.new(i_firstPivotHighColor, 70)
firstBoxLowColor = color.new(i_firstPivotLowColor, 70)
var firstBoxArray = array.new_box()
f_isUpCandle(_index) =>
open[_index] <= close[_index]
f_extendArray(_boxArray) =>
if array.size(_boxArray) > 0
for _i = array.size(_boxArray) - 1 to 0 by 1
boxId = array.get(_boxArray, _i)
box.set_right(boxId, bar_index)
f_pivotHigh(_boxColor, _right, _left, _percentage) =>
pivotHigh = ta.pivothigh(high, _left, _right)
if not na(pivotHigh)
isPercentageChangeEnough = false
for i = 0 to _right + 1 by 1
if (pivotHigh - high[i]) / pivotHigh >= _percentage / 100
isPercentageChangeEnough := true
break
if isPercentageChangeEnough
int candleIndex = _right
for i = _right to _right + _left by 1
if f_isUpCandle(i)
candleIndex := i
break
rangeLow = low[candleIndex]
rangeHigh = high[candleIndex]
b = box.new(bar_index[candleIndex], rangeHigh, bar_index, rangeLow, bgcolor=_boxColor, border_style=line.style_dashed, border_color=_boxColor)
b
f_pivotLow(_boxColor, _right, _left, _percentage) =>
pivotLow = ta.pivotlow(low, _left, _right)
if not na(pivotLow)
isPercentageChangeEnough = false
for i = 0 to _right - 1 by 1
if (low[i] - pivotLow) / pivotLow >= _percentage / 100
isPercentageChangeEnough := true
break
if isPercentageChangeEnough
int candleIndex = _right
for i = _right to _right + _left by 1
if not f_isUpCandle(i)
candleIndex := i
break
rangeLow = low[candleIndex]
rangeHigh = high[candleIndex]
b = box.new(bar_index[candleIndex], rangeHigh, bar_index, rangeLow, bgcolor=_boxColor, border_style=line.style_dashed, border_color=_boxColor)
b
// first box pivots
if i_firstShowPivotBoxes
firstPivotHighBox = f_pivotHigh(firstBoxHighColor, i_firstRight, i_firstLeft, i_firstPercentageChange)
firstPivotLowBox = f_pivotLow(firstBoxLowColor, i_firstRight, i_firstLeft, i_firstPercentageChange)
if not na(firstPivotHighBox)
if array.size(firstBoxArray) == i_firstBoxCount
box.delete(array.shift(firstBoxArray))
array.push(firstBoxArray, firstPivotHighBox)
if not na(firstPivotLowBox)
if array.size(firstBoxArray) == i_firstBoxCount
box.delete(array.shift(firstBoxArray))
array.push(firstBoxArray, firstPivotLowBox)
f_extendArray(firstBoxArray)
2023-01-15
743
글번호 165416
지표