예스스탁
예스스탁 답변
2024-09-26 15:18:03
안녕하세요
예스스탁입니다.
고점은 음봉의 고점
저점은 양봉의 저가
위 내용을 정확히 이해하지 못했습니다.
상승구간은 음봉고가 중 최고가,하락구간은 양봉저가 중 최저가로 계산되게 변경해 드립니다.
input : af(0.02), maxAF(0.2),추세선두께(1),추세선색1(YELLOW),추세선색2(CYAN),연장선두께(2),연장선색(gray);
input : 텍스트출력(1);
var : T(0),HH(0),LL(0),HD(0),HT(0),LD(0),LT(0);
var : HH1(0),LL1(0),HD1(0),HT1(0),LD1(0),LT1(0);
var : TL1(0),TL2(0),cnt(0),count(0);
var : TL3(0),TL4(0),TL5(0),TL6(0),TL7(0);
var : Tx3(0),Tx4(0),Tx5(0),Tx6(0),Tx7(0);
Var : TL11(0),TL22(0);
var1 = CSar(af,maxAF);
plot1(var1);
if crossup(c,var1) Then
{
T = 1;
if C > O Then
{
HH = H;
HD = sdate;
HT = stime;
}
Else
{
HH = 0;
HD = 0;
HT = 0;
}
HH1 = HH[1];
HD1 = HD[1];
HT1 = HT[1];
if LL > 0 Then
{
#TL1 = TL_new(LD[1],LT[1],LL[1],HD,HT,HH);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL3 = TL_new(HD[1],HT[1],HH[1],sdate,stime,HH[1]);
TL4 = TL_new(HD[1],HT[1],(HH[1]+LL)/2,sdate,stime,(HH[1]+LL)/2);
TL5 = TL_new(HD[1],HT[1],LL,sdate,stime,LL);
TL6 = TL_new(HD[1],HT[1],HH[1]+(HH[1]-LL)/2,sdate,stime,HH[1]+(HH[1]-LL)/2);
TL7 = TL_new(HD[1],HT[1],LL-(HH[1]-LL)/2,sdate,stime,LL-(HH[1]-LL)/2);
//추세선 오른쪽 연장설정
TL_SetExtRight(TL3,true);
TL_SetExtRight(TL4,true);
TL_SetExtRight(TL5,true);
TL_SetExtRight(TL6,true);
TL_SetExtRight(TL7,true);
Text_Delete(TX3);
Text_Delete(TX4);
Text_Delete(TX5);
Text_Delete(TX6);
Text_Delete(TX7);
value3 = HH[1];
value4 = (HH[1]+LL)/2;
value5 = LL;
value6 = HH[1]+(HH[1]-LL)/2;
value7 = LL-(HH[1]-LL)/2;
TX3 = Text_New(sDate,sTime,value3,NumToStr(value3,2));
TX4 = Text_New(sDate,sTime,value4,NumToStr(value4,2));
TX5 = Text_New(sDate,sTime,value5,NumToStr(value5,2));
TX6 = Text_New(sDate,sTime,value6,NumToStr(value6,2));
TX7 = Text_New(sDate,sTime,value7,NumToStr(value7,2));
/* if 텍스트출력 == 1 then
{
Tx11 = Text_New(HD1,HT1,HH1,NumToStr((HH1-LL1)/PriceScale,0)+NewLine+NumToStr(HH1,2));
Text_SetStyle(tx11,2,1);
Text_Delete(tx1);
Tx1 = Text_New(HD,HT,HH,NumToStr((HH-LL[1])/PriceScale,0)+NewLine+NumToStr(HH,2));
Text_SetStyle(tx1,2,1);
}*/
}
#TL11 = TL_New(HD1,HT1,HH1,HD,HT,HH);
}
if CrossDown(c,var1) Then
{
T = -1;
LL = L;
LD = sdate;
LT = stime;
LL1 = LL[1];
LD1 = LD[1];
LT1 = LT[1];
if HH > 0 Then
{
#TL2 = TL_new(HD[1],HT[1],HH[1],LD,LT,LL);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL3 = TL_new(LD[1],LT[1],HH,sdate,stime,HH);
TL4 = TL_new(LD[1],LT[1],(HH+LL[1])/2,sdate,stime,(HH+LL[1])/2);
TL5 = TL_new(LD[1],LT[1],LL[1],sdate,stime,LL[1]);
TL6 = TL_new(LD[1],LT[1],LL[1]-(HH-LL[1])/2,sdate,stime,LL[1]-(HH-LL[1])/2);
TL7 = TL_new(LD[1],LT[1],HH[1]+(HH-LL[1])/2,sdate,stime,HH[1]+(HH-LL[1])/2);
//추세선 오른쪽 연장설정
TL_SetExtRight(TL3,true);
TL_SetExtRight(TL4,true);
TL_SetExtRight(TL5,true);
TL_SetExtRight(TL6,true);
TL_SetExtRight(TL7,true);
Text_Delete(TX3);
Text_Delete(TX4);
Text_Delete(TX5);
Text_Delete(TX6);
Text_Delete(TX7);
value3 = HH;
value4 = (HH+LL[1])/2;
value5 = LL[1];
value6 = HH+(HH-LL[1])/2;
value7 = LL[1]-(HH-LL[1])/2;
TX3 = Text_New(sDate,sTime,Value3,NumToStr(Value3,2));
TX4 = Text_New(sDate,sTime,Value4,NumToStr(Value4,2));
TX5 = Text_New(sDate,sTime,Value5,NumToStr(Value5,2));
TX6 = Text_New(sDate,sTime,Value6,NumToStr(Value6,2));
TX7 = Text_New(sDate,sTime,Value7,NumToStr(Value7,2));
/* if 텍스트출력 == 1 then
{
Tx22 = Text_New(LD1,LT1,LL1,NumToStr((HH1-LL1)/PriceScale,0)+NewLine+NumToStr(LL1,2));
Text_SetStyle(tx22,2,0);
Text_Delete(tx2);
Tx2 = Text_New(LD,LT,LL,NumToStr((HH[1]-LL)/PriceScale,0)+NewLine+NumToStr(LL,2));
Text_SetStyle(tx2,2,0);
}*/
}
#TL22 = TL_New(LD1,LT1,LL1,LD,LT,LL);
}
if T == 1 then
{
if C < O and (HH == 0 or (HH > 0 and H > HH)) Then
{
HH = H;
HD = sdate;
HT = stime;
TL_SetEnd(TL1,HD,HT,HH);
TL_SetEnd(TL11,HD,HT,HH);
/* if 텍스트출력 == 1 then
{
Text_Delete(tx1);
Tx1 = Text_New(HD,HT,HH,NumToStr((HH-LL[1])/PriceScale,0)+NewLine+NumToStr(HH,2));
Text_SetStyle(tx1,2,1);
}*/
}
}
if T == -1 then
{
if C > O and (LL == 0 or (LL > 0 and L < LL)) Then
{
LL = L;
LD = sdate;
LT = stime;
TL_SetEnd(TL2,LD,LT,LL);
TL_SetEnd(TL22,LD,LT,LL);
/* if 텍스트출력 == 1 then
{
Text_Delete(tx2);
Tx2 = Text_New(LD,LT,LL,NumToStr((HH[1]-LL)/PriceScale,0)+NewLine+NumToStr(LL,2));
Text_SetStyle(tx2,2,0);
}*/
}
}
#추세선 두께, 색상
TL_SetSize(TL1,추세선두께);
TL_SetSize(TL11,추세선두께);
TL_SetSize(TL2,추세선두께);
TL_SetSize(TL22,추세선두께);
TL_SetColor(TL1,추세선색1);
TL_SetColor(TL11,추세선색1);
TL_SetColor(TL2,추세선색2);
TL_SetColor(TL22,추세선색2);
#연장선 두께, 색상
TL_SetSize(TL3,연장선두께);
TL_SetSize(TL4,연장선두께);
TL_SetSize(TL5,연장선두께);
TL_SetSize(TL6,연장선두께);
TL_SetSize(TL7,연장선두께);
TL_SetColor(TL3,연장선색);
TL_SetColor(TL4,연장선색);
TL_SetColor(TL5,연장선색);
TL_SetColor(TL6,연장선색);
TL_SetColor(TL7,연장선색);
Text_SetLocation(TX3,sDate,sTime,value3);
Text_SetLocation(TX4,sDate,sTime,Value4);
Text_SetLocation(TX5,sDate,sTime,Value5);
Text_SetLocation(TX6,sDate,sTime,Value6);
Text_SetLocation(TX7,sDate,sTime,Value7);
Text_SetStyle(TX3,0,1);
Text_SetStyle(TX4,0,1);
Text_SetStyle(TX5,0,1);
Text_SetStyle(TX6,0,1);
Text_SetStyle(TX7,0,1);
즐거운 하루되세요
> 알리섬 님이 쓴 글입니다.
> 제목 : 수식변경요청
> 안녕하세요 늘 도움 감사드립니다.
아래의 수식에서 ...
고점은 음봉의 고점에...
저점은 양봉의 저가에
고저가 그려지도록 부탁드립니다.
input : af(0.02), maxAF(0.2),추세선두께(1),추세선색1(YELLOW),추세선색2(CYAN),연장선두께(2),연장선색(gray);
input : 텍스트출력(1);
var : T(0),HH(0),LL(0),HD(0),HT(0),LD(0),LT(0);
var : HH1(0),LL1(0),HD1(0),HT1(0),LD1(0),LT1(0);
var : TL1(0),TL2(0),cnt(0),count(0);
var : TL3(0),TL4(0),TL5(0),TL6(0),TL7(0);
var : Tx3(0),Tx4(0),Tx5(0),Tx6(0),Tx7(0);
Var : TL11(0),TL22(0);
var1 = CSar(af,maxAF);
if crossup(c,var1) Then
{
T = 1;
HH = H;
HD = sdate;
HT = stime;
HH1 = HH[1];
HD1 = HD[1];
HT1 = HT[1];
if LL > 0 Then
{
#TL1 = TL_new(LD[1],LT[1],LL[1],HD,HT,HH);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL3 = TL_new(HD[1],HT[1],HH[1],sdate,stime,HH[1]);
TL4 = TL_new(HD[1],HT[1],(HH[1]+LL)/2,sdate,stime,(HH[1]+LL)/2);
TL5 = TL_new(HD[1],HT[1],LL,sdate,stime,LL);
TL6 = TL_new(HD[1],HT[1],HH[1]+(HH[1]-LL)/2,sdate,stime,HH[1]+(HH[1]-LL)/2);
TL7 = TL_new(HD[1],HT[1],LL-(HH[1]-LL)/2,sdate,stime,LL-(HH[1]-LL)/2);
//추세선 오른쪽 연장설정
TL_SetExtRight(TL3,true);
TL_SetExtRight(TL4,true);
TL_SetExtRight(TL5,true);
TL_SetExtRight(TL6,true);
TL_SetExtRight(TL7,true);
Text_Delete(TX3);
Text_Delete(TX4);
Text_Delete(TX5);
Text_Delete(TX6);
Text_Delete(TX7);
value3 = HH[1];
value4 = (HH[1]+LL)/2;
value5 = LL;
value6 = HH[1]+(HH[1]-LL)/2;
value7 = LL-(HH[1]-LL)/2;
TX3 = Text_New(sDate,sTime,value3,NumToStr(value3,2));
TX4 = Text_New(sDate,sTime,value4,NumToStr(value4,2));
TX5 = Text_New(sDate,sTime,value5,NumToStr(value5,2));
TX6 = Text_New(sDate,sTime,value6,NumToStr(value6,2));
TX7 = Text_New(sDate,sTime,value7,NumToStr(value7,2));
/* if 텍스트출력 == 1 then
{
Tx11 = Text_New(HD1,HT1,HH1,NumToStr((HH1-LL1)/PriceScale,0)+NewLine+NumToStr(HH1,2));
Text_SetStyle(tx11,2,1);
Text_Delete(tx1);
Tx1 = Text_New(HD,HT,HH,NumToStr((HH-LL[1])/PriceScale,0)+NewLine+NumToStr(HH,2));
Text_SetStyle(tx1,2,1);
}*/
}
#TL11 = TL_New(HD1,HT1,HH1,HD,HT,HH);
}
if CrossDown(c,var1) Then
{
T = -1;
LL = L;
LD = sdate;
LT = stime;
LL1 = LL[1];
LD1 = LD[1];
LT1 = LT[1];
if HH > 0 Then
{
#TL2 = TL_new(HD[1],HT[1],HH[1],LD,LT,LL);
TL_Delete(TL3);
TL_Delete(TL4);
TL_Delete(TL5);
TL_Delete(TL6);
TL_Delete(TL7);
TL3 = TL_new(LD[1],LT[1],HH,sdate,stime,HH);
TL4 = TL_new(LD[1],LT[1],(HH+LL[1])/2,sdate,stime,(HH+LL[1])/2);
TL5 = TL_new(LD[1],LT[1],LL[1],sdate,stime,LL[1]);
TL6 = TL_new(LD[1],LT[1],LL[1]-(HH-LL[1])/2,sdate,stime,LL[1]-(HH-LL[1])/2);
TL7 = TL_new(LD[1],LT[1],HH[1]+(HH-LL[1])/2,sdate,stime,HH[1]+(HH-LL[1])/2);
//추세선 오른쪽 연장설정
TL_SetExtRight(TL3,true);
TL_SetExtRight(TL4,true);
TL_SetExtRight(TL5,true);
TL_SetExtRight(TL6,true);
TL_SetExtRight(TL7,true);
Text_Delete(TX3);
Text_Delete(TX4);
Text_Delete(TX5);
Text_Delete(TX6);
Text_Delete(TX7);
value3 = HH;
value4 = (HH+LL[1])/2;
value5 = LL[1];
value6 = HH+(HH-LL[1])/2;
value7 = LL[1]-(HH-LL[1])/2;
TX3 = Text_New(sDate,sTime,Value3,NumToStr(Value3,2));
TX4 = Text_New(sDate,sTime,Value4,NumToStr(Value4,2));
TX5 = Text_New(sDate,sTime,Value5,NumToStr(Value5,2));
TX6 = Text_New(sDate,sTime,Value6,NumToStr(Value6,2));
TX7 = Text_New(sDate,sTime,Value7,NumToStr(Value7,2));
/* if 텍스트출력 == 1 then
{
Tx22 = Text_New(LD1,LT1,LL1,NumToStr((HH1-LL1)/PriceScale,0)+NewLine+NumToStr(LL1,2));
Text_SetStyle(tx22,2,0);
Text_Delete(tx2);
Tx2 = Text_New(LD,LT,LL,NumToStr((HH[1]-LL)/PriceScale,0)+NewLine+NumToStr(LL,2));
Text_SetStyle(tx2,2,0);
}*/
}
#TL22 = TL_New(LD1,LT1,LL1,LD,LT,LL);
}
if T == 1 then
{
if H > HH Then
{
HH = H;
HD = sdate;
HT = stime;
TL_SetEnd(TL1,HD,HT,HH);
TL_SetEnd(TL11,HD,HT,HH);
/* if 텍스트출력 == 1 then
{
Text_Delete(tx1);
Tx1 = Text_New(HD,HT,HH,NumToStr((HH-LL[1])/PriceScale,0)+NewLine+NumToStr(HH,2));
Text_SetStyle(tx1,2,1);
}*/
}
}
if T == -1 then
{
if L < LL Then
{
LL = L;
LD = sdate;
LT = stime;
TL_SetEnd(TL2,LD,LT,LL);
TL_SetEnd(TL22,LD,LT,LL);
/* if 텍스트출력 == 1 then
{
Text_Delete(tx2);
Tx2 = Text_New(LD,LT,LL,NumToStr((HH[1]-LL)/PriceScale,0)+NewLine+NumToStr(LL,2));
Text_SetStyle(tx2,2,0);
}*/
}
}
#추세선 두께, 색상
TL_SetSize(TL1,추세선두께);
TL_SetSize(TL11,추세선두께);
TL_SetSize(TL2,추세선두께);
TL_SetSize(TL22,추세선두께);
TL_SetColor(TL1,추세선색1);
TL_SetColor(TL11,추세선색1);
TL_SetColor(TL2,추세선색2);
TL_SetColor(TL22,추세선색2);
#연장선 두께, 색상
TL_SetSize(TL3,연장선두께);
TL_SetSize(TL4,연장선두께);
TL_SetSize(TL5,연장선두께);
TL_SetSize(TL6,연장선두께);
TL_SetSize(TL7,연장선두께);
TL_SetColor(TL3,연장선색);
TL_SetColor(TL4,연장선색);
TL_SetColor(TL5,연장선색);
TL_SetColor(TL6,연장선색);
TL_SetColor(TL7,연장선색);
Text_SetLocation(TX3,sDate,sTime,value3);
Text_SetLocation(TX4,sDate,sTime,Value4);
Text_SetLocation(TX5,sDate,sTime,Value5);
Text_SetLocation(TX6,sDate,sTime,Value6);
Text_SetLocation(TX7,sDate,sTime,Value7);
Text_SetStyle(TX3,0,1);
Text_SetStyle(TX4,0,1);
Text_SetStyle(TX5,0,1);
Text_SetStyle(TX6,0,1);
Text_SetStyle(TX7,0,1);