예스스탁
예스스탁 답변
2022-09-20 11:45:29
안녕하세요
예스스탁입니다.
1
수식에 괄호{}가 빠진 부분이 있습니다.
시스템식으로 작성후 적용하셔야 합니다.
Input:전환포인트(1);
Var:j(0),upTr(100),dnTr(-100),trnd(0),TL(0),
date11(0),date12(0),time11(0),time12(0),TL1(0),
date21(0),date22(0),time21(0),time22(0),TL2(0),
date31(0),date32(0),time31(0),time32(0),TL3(0);
Array:hiVal[10](0),loVal[10](0),hiBar[10](0),loBar[10](0);
var : TL13(0),TL14(0),color(0),Tx1(0),Tx2(0),tx3(0),tx4(0);
for j = 1 to 9
{
loBar[j] = loBar[j] + 1;
hiBar[j] = hiBar[j] + 1;
}
if hiVal[0] <= H or hiVal[0] == 0 then
{
hiVal[0] = H;
hiBar[0] = 0;
}
else
{
hiBar[0] = hiBar[0] + 1;
}
if loVal[0] >= L or loVal[0] == 0 then
{
loVal[0] = L;
loBar[0] = 0;
}
else
{
loBar[0] = loBar[0] + 1;
}
if trnd != dnTr && hiVal[0] > H && hiVal[0]-전환포인트 > L then
trnd = dnTr;
else if trnd != upTr && loVal[0] < L && loVal[0]+전환포인트 < H then
trnd = upTr;
if trnd[1] == upTr and trnd == dnTr then
{
SELL();
for j = 8 downto 1
{
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date11 = date[loBar[1]]; //추세선 시작일. 전저점의 날짜
time11 = stime[loBar[1]]; //추세선 시작시간
Value11 = loVal[1]; //추세선 시작가격
date12 = date[hiBar[1]]; //추세선 종료일. 전고점의 날짜
time12 = stime[hiBar[1]]; //추세선 종료시간
Value12 = hiVal[1]; //추세선 종료가격
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
}
if trnd[1] == dnTr and trnd == dnTr and
hiVal[1] < hiVal[0] and
hiVal[0]-전환포인트 > L then
{
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date12 = date[hiBar[1]]; //추세선 종료일
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
TL_SetEnd(TL1, date12,time12,Value12);
}
if trnd[1] == dnTr and trnd == upTr then
{
BUY();
for j = 8 downto 1
{
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date11 = date[hiBar[1]];
time11 = stime[hiBar[1]];
Value11 = hiVal[1];
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
}
if trnd[1] == upTr and trnd == upTr and
loVal[1] > loVal[0] and
loVal[0]+전환포인트 < H then
{
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
TL_SetEnd(TL1, date12,time12,Value12);
}
if trnd == upTr and loVal[2] > loVal[1] then
{
TL_SetColor(TL1,BLUE);
color = blue;
}
else if trnd == dnTr and hiVal[2] < hiVal[1] then
{
TL_SetColor(TL1,RED);
color = RED;
}
else
{
TL_SetColor(TL1,BLACK);
color = BLACK;
}
TL_SetSize(TL1,2);
TL_SetColor(TL2,RED);
TL_SetColor(TL3,BLUE);
2
var : dh(0),dl(0);
var : sumhv(0),sumlv(0),avgh(0);
var : sumhi(0),sumli(0),avgl(0);
if bdate != Bdate[1] Then
{
dh = h;
sumhv = dh;
sumhi = 1;
dl = l;
sumlv = dl;
sumli = 1;
}
Else
{
if h > dh Then
{
dh = H;
sumhv = sumhv+dh;
sumhi = sumhi+1;
}
if l < dl Then
{
dl = l;
sumlv = sumlv+dl;
sumli = sumli+1;
}
}
avgh = sumhv/sumhi;
avgl = sumlv/sumli;
Plot1(avgh);
Plot2(avgl);
즐거운 하루되세요
> 대발이 님이 쓴 글입니다.
> 제목 : 수식문의
> 1.지표구현이 안돼서요.확인좀 부탁 합니다.
Input:전환포인트(1);
Var:j(0),upTr(100),dnTr(-100),trnd(0),TL(0),
date11(0),date12(0),time11(0),time12(0),TL1(0),
date21(0),date22(0),time21(0),time22(0),TL2(0),
date31(0),date32(0),time31(0),time32(0),TL3(0);
Array:hiVal[10](0),loVal[10](0),hiBar[10](0),loBar[10](0);
var : TL13(0),TL14(0),color(0),Tx1(0),Tx2(0),tx3(0),tx4(0);
for j = 1 to 9 {
loBar[j] = loBar[j] + 1;
hiBar[j] = hiBar[j] + 1;
}
if hiVal[0] <= H or hiVal[0] == 0 then
{
hiVal[0] = H;
hiBar[0] = 0;
}
else
{
hiBar[0] = hiBar[0] + 1;
}
if loVal[0] >= L or loVal[0] == 0 then
{
loVal[0] = L;
loBar[0] = 0;
}
else
{
loBar[0] = loBar[0] + 1;
}
if trnd != dnTr && hiVal[0] > H && hiVal[0]-전환포인트 > L then
trnd = dnTr;
else if trnd != upTr && loVal[0] < L && loVal[0]+전환포인트 < H then
trnd = upTr;
if trnd[1] == upTr and trnd == dnTr then
{
SELL();
for j = 8 downto 1
{
hiVal[j+1] = hiVal[j];
hiBar[j+1] = hiBar[j];
}
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date11 = date[loBar[1]]; //추세선 시작일. 전저점의 날짜
time11 = stime[loBar[1]]; //추세선 시작시간
Value11 = loVal[1]; //추세선 시작가격
date12 = date[hiBar[1]]; //추세선 종료일. 전고점의 날짜
time12 = stime[hiBar[1]]; //추세선 종료시간
Value12 = hiVal[1]; //추세선 종료가격
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
}
if trnd[1] == dnTr and trnd == dnTr and
hiVal[1] < hiVal[0] and
hiVal[0]-전환포인트 > L then {
hiVal[1] = hiVal[0];
hiBar[1] = hiBar[0];
hiVal[0] = H;
hiBar[0] = 0;
loVal[0] = L;
loBar[0] = 0;
date12 = date[hiBar[1]]; //추세선 종료일
time12 = stime[hiBar[1]];
Value12 = hiVal[1];
TL_SetEnd(TL1, date12,time12,Value12);
if trnd[1] == dnTr and trnd == upTr then
{
BUY();
for j = 8 downto 1
{
loVal[j+1] = loVal[j];
loBar[j+1] = loBar[j];
}
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date11 = date[hiBar[1]];
time11 = stime[hiBar[1]];
Value11 = hiVal[1];
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
}
if trnd[1] == upTr and trnd == upTr and
loVal[1] > loVal[0] and
loVal[0]+전환포인트 < H then
{
loVal[1] = loVal[0];
loBar[1] = loBar[0];
loVal[0] = L;
loBar[0] = 0;
hiVal[0] = H;
hiBar[0] = 0;
date12 = date[loBar[1]];
time12 = stime[loBar[1]];
Value12 = loVal[1];
TL_SetEnd(TL1, date12,time12,Value12);
}
if trnd == upTr and loVal[2] > loVal[1] then{
TL_SetColor(TL1,BLUE);
color = blue;
}
else if trnd == dnTr and hiVal[2] < hiVal[1] then{
TL_SetColor(TL1,RED);
color = RED;
}
else
{
TL_SetColor(TL1,BLACK);
color = BLACK;
}
TL_SetSize(TL1,2);
TL_SetColor(TL2,RED);
TL_SetColor(TL3,BLUE);
2. 분봉에서 첫봉이 완성되면, 첫봉의 고,저점이 당일 고가,저가가 됩니다.
a지표 ; 이때, 첫봉포함 새로운 고점을 만든봉만의 고점 누적평균값.[이전 당일 고점과
동일가제외]
b지표 ; " 저점을 " 저점 " [ "
]
c지표 ; " , 첫봉포함 새로운 고점,저점을 만든봉들만의 고점,저점 평균값.
즉, 첫봉포함해서 신고점,저점을 만든 봉만을 평균 하고 싶은것입니다.