예스스탁
예스스탁 답변
2025-01-07 14:01:40
안녕하세요
예스스탁입니다.
Input : af(0.07), maxAF(0.2);
var : t(0),tl(0),tl1(0),tl2(0),tx1(0),tx2(0),color(0);
var : hh(0),hd(0),ht(0),hh1(0),tl11(0);
var : ll(0),ld(0),lt(0),ll1(0),tl22(0);
var : ar(0),ad(0),aa(0),cnt(0),br(0),bd(0),bb(0);
Array : aTL[10](0),bTL[10](0);
var1 = SAR(af,maxAF);
if CrossUp(C,var1) Then
{
T = 1;
hh = var1;
hh1 = hh[1];
hd = sDate;
ht = sTime;
if ll > 0 Then
{
tl = TL_New(ld,lt,ll,hd,ht,hh);
tl1 = TL_New(hd,ht,hh,NextBarSdate,NextBarStime,hh);
tx1 = Text_New(sDate,sTime,hh,NumToStr(hh,2)+NewLine+"+"+NumToStr(abs(hh-ll)/PriceScale,0));
Text_SetStyle(tx1,2,0);
if hh1 == 0 or (hh1 > 0 and hh < hh1) Then
color = Blue;
aD = 0;
if abs(hh-ll) > PriceScale*50 Then
{
aR = Floor(abs(hh-LL)/(PriceScale*50));
aa = hh;
For cnt = 1 to ar
{
if hh+(PriceScale*50)*cnt < LL Then
{
aD = aD+1;
aTL[aD] = TL_New(sDate,sTime,aa+(PriceScale*50)*cnt,NextBarSdate,NextBarStime,aa+(PriceScale*50)*cnt);
}
}
}
}
}
else if CrossDown(C,var1) Then
{
T = -1;
ll = var1;
ll1 = ll[1];
ld = sDate;
lt = sTime;
if hh > 0 Then
{
tl = TL_New(hd,ht,hh,ld,lt,ll);
tl2 = TL_New(ld,lt,ll,NextBarSdate,NextBarStime,ll);
tx2 = Text_New(sDate,sTime,ll,NumToStr(ll,2)+NewLine+"-"+NumToStr(abs(hh-ll)/PriceScale,0));
Text_SetStyle(tx2,2,0);
if ll1 == 0 or (ll1 > 0 and ll > ll1) Then
color = Red;
bD = 0;
if abs(hh-ll) > PriceScale*50 Then
{
bR = Floor(abs(hh-LL)/(PriceScale*50));
bb = ll;
For cnt = 1 to br
{
if ll-(PriceScale*50)*cnt > HH Then
{
bD = bD+1;
bTL[bD] = TL_New(sDate,sTime,bb-(PriceScale*50)*cnt,NextBarSdate,NextBarStime,bb-(PriceScale*50)*cnt);
}
}
}
}
}
Else
{
if t == 1 then
{
TL_SetEnd(tl,hd,ht,hh);
TL_SetBegin(tl1,hd,ht,hh);
TL_SetEnd(tl11,Sdate[1],Stime[1],hh1);
Text_SetString(tx1,NumToStr(hh,2)+NewLine+"+"+NumToStr(abs(hh-ll)/PriceScale,0));
Text_SetLocation(tx1,sDate,sTime,hh);
if (hh1 > 0 and hh > hh1) Then
color = Red;
}
if t == -1 then
{
TL_SetEnd(tl,ld,lt,ll);
TL_SetBegin(tl2,ld,lt,ll);
TL_SetEnd(tl22,Sdate[1],Stime[1],ll1);
Text_SetString(tx2,NumToStr(ll,2)+NewLine+"-"+NumToStr(abs(hh-ll)/PriceScale,0));
Text_SetLocation(tx2,sDate,sTime,ll);
if (ll1 > 0 and ll < ll1) Then
color = Blue;
}
}
TL_SetEnd(tl1,NextBarSdate,NextBarStime,hh);
TL_SetEnd(tl2,NextBarSdate,NextBarStime,ll);
TL_SetColor(tl,color);
if aD > 0 Then
{
For cnt = 1 to aD
{
TL_SetEnd(aTL[cnt],NextBarSdate,NextBarStime,aa+(PriceScale*50)*cnt);
}
}
if bD > 0 Then
{
For cnt = 1 to bD
{
TL_SetEnd(bTL[cnt],NextBarSdate,NextBarStime,bb-(PriceScale*50)*cnt);
}
}
if abs(HH-LL) >= PriceScale*50 Then
TL_SetSize(tl,5);
Else
TL_SetSize(tl,2);
즐거운 하루되세요
> 요타 님이 쓴 글입니다.
> 제목 : 질문 요청 드립니다.(피뽀)
> * 좋은 한주 되십시요.
* 아래 수식에서 지그재그선이 만들어 지는데
1. 50틱 보다 크면 선굵기를 5 로 표시
2. 50틱 단위로 중간중간 표시가 가능 한가요?
즉 차이가 100틱 이면 중간에 선이 두개 149틱 이면 두개 150틱이면 3개....
## 아래 수식
Input : af(0.07), maxAF(0.2);
var : t(0),tl(0),tl1(0),tl2(0),tx1(0),tx2(0),color(0);
var : hh(0),hd(0),ht(0),hh1(0),tl11(0);
var : ll(0),ld(0),lt(0),ll1(0),tl22(0);
var1 = SAR(af,maxAF);
if CrossUp(C,var1) Then
{
T = 1;
hh = var1;
hh1 = hh[1];
hd = sDate;
ht = sTime;
if ll > 0 Then
{
tl = TL_New(ld,lt,ll,hd,ht,hh);
tl1 = TL_New(hd,ht,hh,NextBarSdate,NextBarStime,hh);
tx1 = Text_New(sDate,sTime,hh,NumToStr(hh,2)+NewLine+"+"+NumToStr(abs(hh-ll)/PriceScale,0));
Text_SetStyle(tx1,2,1);
if hh1 == 0 or (hh1 > 0 and hh < hh1) Then
color = Blue;
}
}
else if CrossDown(C,var1) Then
{
T = -1;
ll = var1;
ll1 = ll[1];
ld = sDate;
lt = sTime;
if hh > 0 Then
{
tl = TL_New(hd,ht,hh,ld,lt,ll);
tl2 = TL_New(ld,lt,ll,NextBarSdate,NextBarStime,ll);
tx2 = Text_New(sDate,sTime,ll,NumToStr(ll,2)+NewLine+"-"+NumToStr(abs(hh-ll)/PriceScale,0));
Text_SetStyle(tx2,2,0);
if ll1 == 0 or (ll1 > 0 and ll > ll1) Then
color = Red;
}
}
Else
{
if t == 1 then
{
TL_SetEnd(tl,hd,ht,hh);
TL_SetBegin(tl1,hd,ht,hh);
TL_SetEnd(tl11,Sdate[1],Stime[1],hh1);
Text_SetString(tx1,NumToStr(hh,2)+NewLine+"+"+NumToStr(abs(hh-ll)/PriceScale,0));
Text_SetLocation(tx1,sDate,sTime,hh);
if (hh1 > 0 and hh > hh1) Then
color = Red;
}
if t == -1 then
{
TL_SetEnd(tl,ld,lt,ll);
TL_SetBegin(tl2,ld,lt,ll);
TL_SetEnd(tl22,Sdate[1],Stime[1],ll1);
Text_SetString(tx2,NumToStr(ll,2)+NewLine+"-"+NumToStr(abs(hh-ll)/PriceScale,0));
Text_SetLocation(tx2,sDate,sTime,ll);
if (ll1 > 0 and ll < ll1) Then
color = Blue;
}
}
TL_SetEnd(tl1,NextBarSdate,NextBarStime,hh);
TL_SetEnd(tl2,NextBarSdate,NextBarStime,ll);
TL_SetColor(tl,color);
TL_SetSize(tl,2) ;
* 항상 많은 도움 고맙습니다.