답변완료
수식 요청 좀 드림니다.
* 항상 많은 도움에 고맙습니다.
* 아래 수식에서 바탕박스 색상이 구분되는데
* 박스 색상이 맞게 4등분선 좀 요청 드림니다.
* 최고선, 최저선, 중간선, 하중간선, 상중간선, 5줄 입니다(그림참고)
## 수식
var1 = ma(c,5) ;
var2 = ma(c,20) ;
##===================================================================================================================
##===================================================================================================================
var : box(0);
var : dd1(0),cnt2(0);
var : TL11(0),TL2(0),TX1(0),TX2(0);
if CrossUp( var1 ,var2 ) Then
{
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Rgb(255,150,0));
Box_SetFill(box,true);
Box_SetExtFill(box,true);
Box_SetSize(box,5);
value1 = H;
Value2 = L;
// TL11 = TL_New(sDate,sTime,value1,NextBarSdate,NextBarStime,value1);
// TL2 = TL_New(sDate,sTime,value2,NextBarSdate,NextBarStime,value2);
TL_SetColor(TL11,Rgb(255,0,0));
TL_SetColor(TL2,Rgb(255,0,0));
TL_SetSize(TL11,5);
TL_SetSize(TL2,5);
// TX1 = Text_New(NextBarSdate,NextBarStime,value1,NumToStr(value1,2));
// TX2 = Text_New(NextBarSdate,NextBarStime,value2,NumToStr(Value2,2));
Text_SetStyle(TX1,0,2);
Text_SetStyle(TX2,0,2);
Text_SetSize(TX1,15);
Text_SetSize(TX2,15);
//PlaySound("C:₩CyberOrO₩Wav₩3₩last30.wav");
}
else
## 하락 음봉
if CrossDown( var1 ,var2 ) Then
{
box = Box_New(sDate,sTime,h,NextBarSdate,NextBarStime,l);
Box_SetColor(box,Rgb(0,255,255) );
Box_SetFill(box,true);
Box_SetExtFill(box,true);
Box_SetSize(box,5);
value1 = H;
Value2 = L;
// TL11 = TL_New(sDate,sTime,value1,NextBarSdate,NextBarStime,value1);
// TL2 = TL_New(sDate,sTime,value2,NextBarSdate,NextBarStime,value2);
TL_SetColor(TL11,Rgb(0,0,0) );
TL_SetColor(TL2,Rgb(0,0,0) );
TL_SetSize(TL11,5);
TL_SetSize(TL2,1);
// TX1 = Text_New(NextBarSdate,NextBarStime,value1,NumToStr(value1,2));
// TX2 = Text_New(NextBarSdate,NextBarStime,value2,NumToStr(Value2,2));
Text_SetStyle(TX1,0,0);
Text_SetStyle(TX2,0,0);
Text_SetSize(TX1,13);
Text_SetSize(TX2,13);
Text_SetBold(TX1,15);
Text_SetBold(TX2,15);
//PlaySound("C:₩CyberOrO₩Wav₩3₩last60.wav");
}
Else
{
Box_SetEnd(box,NextBarSdate,NextBarStime,l);
TL_SetEnd(TL11,NextBarSdate,NextBarStime,value1);
TL_SetEnd(TL2,NextBarSdate,NextBarStime,value2);
Text_SetLocation(TX1,NextBarSdate,NextBarStime,value1);
Text_SetLocation(TX2,NextBarSdate,NextBarStime,value2);
Text_SetBold(TX1,0);
Text_SetBold(TX2,0);
}
* 감사 합니다.
2025-04-03
327
글번호 189805
강조
답변완료
문의드립니다.
아래 수식은 분봉차트에 사용하는 지표입니다. 이 지표를 틱봉차트에 나타내고자 합니다.
분봉의 기간값은 수정가능하게 부탁드립니다.
항상 감사드립니다. 수고하세요!!!
======================
input : left(5),right(5);
input : left1(30),right1(30);
input : dist(2.00);
input : upcolor(White);
input : downcolor(White);
var : ph(0),currenth(0),lasth(0),pl(0),currentl(0),lastl(0);
var : ms(0),l1(0),l2(0),l3(0),l4(0);
if SwingHigh(1,H,left,right,Left+right+1) != -1 Then
{
ph = H[right];
currenth = h[right];
lasth = currenth[1];
l1 = TL_New(sDate[right],sTime[right],ph,sDate,sTime,ph);
TL_SetColor(l1,upcolor);
TL_SetStyle(l1,3);
var1 = Index;
}
Else
{
if var1 > 0 and Index <= var1+Round(Right/2,0) Then
TL_SetEnd(l1,sDate,sTime,ph);
}
if Swinglow(1,L,left,right,Left+right+1) != -1 Then
{
pl = L[right];
currentl = l[right];
lastl = currentl[1];
l2 = TL_New(sDate[right],sTime[right],pl,sDate,sTime,pl);
TL_SetColor(l2,downcolor);
TL_SetStyle(l2,3);
var2 = Index;
}
Else
{
if var2 > 0 and Index <= var2+Round(Right/2,0) Then
TL_SetEnd(l2,sDate,sTime,pl);
}
if currenth > lasth and currentl > lastl and close > ph Then
ms = 2;
else if currenth < lasth and currentl < lastl and close < pl Then
ms = -2;
else if close > ph Then
ms = 1;
else if close < pl Then
ms = -1;
var : longsig(False),shortsig(False),longsig1(False),shortsig1(False);
var : longsig2(False),shortsig2(false),longexit(False),shortexit(False);
var : ph1(0),pl1(0),mav(0),a(0),ma2(0),ma3(0);
longsig = close > ph and ms[1] < 0;
shortsig = close < pl and ms[1] > 0;
longsig1 = close > ph and ms[1] > 0;
shortsig1 = close < pl and ms[1] < 0;
longsig2 = longsig1 and longsig1[1] == false and longsig[1] == false;
shortsig2 = shortsig1 and shortsig1[1] == false and shortsig[1] == false;
longexit = high > ph and close < ph;
shortexit = low < pl and close > pl;
if SwingHigh(1,H,left1,right1,Left1+right1+1) != -1 Then
{
ph1 = H[right1];
l3 = TL_New(sDate[right1],sTime[right1],ph1,sDate,sTime,ph1);
TL_SetColor(l3,upcolor);
TL_SetDrawMode(l3,0);
var3 = Index;
}
Else
{
if var3 > 0 and Index <= var3+Round(Right1/2,0) Then
TL_SetEnd(l3,sDate,sTime,ph1);
}
if Swinglow(1,L,left1,right1,Left1+right1+1) != -1 Then
{
pl1 = L[right1];
l4 = TL_New(sDate[right1],sTime[right1],pl1,sDate,sTime,pl1);
TL_SetColor(l4,downcolor);
TL_SetDrawMode(l4,0);
var4 = Index;
}
Else
{
if var4 > 0 and Index <= var4+Round(Right1/2,0) Then
TL_SetEnd(l4,sDate,sTime,pl1);
}
// Zone
mav = ma(close, left1);
a = atr(left1);
ma2 = iff(ms > 0 and ms[1] > 0 , mav - a * dist ,IFf( ms < 0 and ms[1] < 0 , mav + a*dist , Nan));
ma3 = iff(ms > 0 and ms[1] > 0 , ma2 + a ,IFf( ms < 0 and ms[1] < 0 , ma2 - a , Nan));
var : tx1(0),tx2(0),tx3(0),tx4(0),tx5(0),tx6(0);
if longsig Then
{
tx1 = Text_New(sDate,sTime,L,"↑");
Text_SetStyle(tx1,2,0);
Text_SetColor(tx1,Blue);
}
if longsig2 Then
{
tx2 = Text_New(sDate,sTime,L,"↑");
Text_SetStyle(tx2,2,0);
Text_SetColor(tx2,Blue);
}
if shortsig Then
{
tx3 = Text_New(sDate,sTime,H,"↓");
Text_SetStyle(tx3,2,1);
Text_SetColor(tx3,Red);
}
if shortsig2 Then
{
tx4 = Text_New(sDate,sTime,H,"↓");
Text_SetStyle(tx4,2,1);
Text_SetColor(tx4,Red);
}
plot1(ma2, "External Zone", IFf(close > ma2 , upcolor, IFf(close < ma2 , downcolor, Nan)));
plot2(ma3, "Internal Zone", iff(close > ma2 , upcolor, iff(close < ma2 , downcolor, Nan)));
2025-04-03
293
글번호 189800
지표