커뮤니티
부탁드립니다
input : P1(10),P2(60);
var : mav1(0),s1(0),d1(0),t1(0),h1(0),l1(0),box1(0);
var : mav2(0),s2(0),d2(0),t2(0),h2(0),l2(0),box2(0);
var : count1(0),count2(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
if mav1 > mav1[1] Then
s1 = 1;
if mav1 < mav1[1] Then
s1 = -1;
if mav2 > mav2[1] Then
s2 = 1;
if mav2 < mav2[1] Then
s2 = -1;
if s2 == 1 Then
{
if s2 != s2[1] Then
{
d2 = sDate;
t2 = sTime;
h2 = h;
l2 = l;
box2 = Box_New(sDate,sTime,h2,NextBarSdate,NextBarStime,l2);
Box_SetColor(box2,Red);
count1 = 0;
}
Else
{
if h > h2 Then
h2 = h;
if l < l2 Then
l2 = l;
Box_SetBegin(box2,d2,t2,h2);
Box_SetEnd(box2,NextBarSdate,NextBarStime,l2);
}
}
if s2 == -1 Then
{
if s2 != s2[1] Then
{
d2 = sDate;
t2 = sTime;
h2 = h;
l2 = l;
box2 = Box_New(sDate,sTime,h2,NextBarSdate,NextBarStime,l2);
Box_SetColor(box2,Blue);
count2 = 0;
}
Else
{
if h > h2 Then
h2 = h;
if l < l2 Then
l2 = l;
Box_SetBegin(box2,d2,t2,h2);
Box_SetEnd(box2,NextBarSdate,NextBarStime,l2);
}
}
if s1 == 1 Then
{
if s1 != s1[1] Then
{
d1 = sDate;
t1 = sTime;
h1 = h;
l1 = l;
box1 = Box_New(sDate,sTime,h1,NextBarSdate,NextBarStime,l1);
Box_SetColor(box1,Magenta);
count1 = count1+1;
if S2 == 1 and count1 == 1 Then
{
Buy("B");
Box_SetFill(box1,true);
}
}
Else
{
if h > h1 Then
h1 = h;
if l < l1 Then
l1 = l;
Box_SetBegin(box1,d1,t1,h1);
Box_SetEnd(box1,NextBarSdate,NextBarStime,l1);
}
}
if s1 == -1 Then
{
if s1 != s1[1] Then
{
d1 = sDate;
t1 = sTime;
h1 = h;
l1 = l;
box1 = Box_New(sDate,sTime,h1,NextBarSdate,NextBarStime,l1);
Box_SetColor(box1,Cyan);
count2 = count2+1;
if S2 == -1 and count2 == 1 Then
{
Sell("S");
Box_SetFill(box1,true);
}
}
Else
{
if h > h1 Then
h1 = h;
if l < l1 Then
l1 = l;
Box_SetBegin(box1,d1,t1,h1);
Box_SetEnd(box1,NextBarSdate,NextBarStime,l1);
}
}
위의 수식에 큰박스 고저라인좀 부탁드립니다
답변 1
예스스탁 예스스탁 답변
2026-04-30 14:56:54