답변완료
문의드립니다.
늘 고맙습니다.
식을 만드는데 도저히 해결이 안되는 부분이 있습니다. 꼭 해결방법 부탁드립니다.
#1. 시스템식에서 조건을 변경을 해도 신호가 나오는 것이 똑같은 경우가 꽤 있습니다. 식이 틀렸나 하고 다시 작성하거나 로그인 다시해도 전혀 바뀌지를 않습니다. 전에 접속하셔서 해결해주셨는데 어떻게 해야하는지 잘 모르겠습니다. 부탁드립니다.
#2. 위 1번 질문의 한 예입니다. 현재 해결을 못하고 있습니다.
제 차례가 다가오는 것 같아 다시 수정해서 돌려보니 전혀 다른 자리에 선긋기가 되고 있습니다. 식을 수정하고 뭔가 다른 조치를 취해야 되는 것 같네요. ㅠㅠ
input : StartTime1(170000),EndTime1(190000);
input : StartTime2(190000),EndTime2(240000);
input : StartTime3(240000),EndTime3(040000);
input : StartTime4(040000),EndTime4(060000);
var : Tcond1(false),Tcond2(false),Tcond3(false),Tcond4(false);
#############################################################################
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond1 = true;
}
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
{
Tcond1 = False;
}
#############################################################################
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond2 = true;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
{
Tcond2 = False;
}
#############################################################################
if (sdate != sdate[1] and stime >= StartTime3) or
(sdate == sdate[1] and stime >= StartTime3 and stime[1] < StartTime3) Then
{
Tcond3 = true;
}
if (sdate != sdate[1] and stime >= EndTime3) or
(sdate == sdate[1] and stime >= EndTime3 and stime[1] < EndTime3) Then
{
Tcond3 = False;
}
#############################################################################
if (sdate != sdate[1] and stime >= StartTime4) or
(sdate == sdate[1] and stime >= StartTime4 and stime[1] < StartTime4) Then
{
Tcond4 = true;
}
if (sdate != sdate[1] and stime >= EndTime4) or
(sdate == sdate[1] and stime >= EndTime4 and stime[1] < EndTime4) Then
{
Tcond4 = False;
}
if tcond2 and 조건1 and 조건2 then
{
a1=1;
a1i1=index;
a1매수=O;
}
if a1==1 and index-a1i1<50 and tcond3 and L<a1매수 then
{
a1=2;
buy("a1매수",atlimit,a1매수);
# 위를 저장하고 아래와 같이 실행을 해보면 차트전체가 모두 노란줄이 그어집니다.
# 또 tcond2 대신에 tcond3으로 바꾸면 아무줄도 생기지 않습니다.
# 13개를 다른 시간대로 설정했는데 2와 3 두개만 이상한 현상이 생깁니다.
if tcond2 Then
{
value98 = TL_New(sDate,sTime,0,sDate,sTime,999999999);
TL_SetColor(Value98,Yellow);
TL_SetSize(Value98,1);
}
#3. 5분봉으로 본장 시작전과 후의 봉을 저장하려고 합니다.
sTime을 사용해보니 아래 선긋기가 나오지 않습니다.
Time을 사용하니 선긋기는 나옵니다.
value98 = TL_New(sDate,sTime,0,sDate,sTime,999999999);
TL_SetColor(Value98,Yellow);
TL_SetSize(Value98,1);
그러면 Time을 써서 아래와 같이 식을 작성하면 괄호안의 내용들을 그 캔들 번호에 저장이 되는건가요?
if Time == 083000 Then
{
진폭프리장=DayHigh-DayLow; #당일 프리장까지의 진폭
저점프리장=DayLow; #당일 프리장까지의 저점
고점프리장=DayHigh; #당일 프리장까지의 고점
O프리장=O; #프리장 마지막 캔들의 시가
C프리장=C; #프리장 마지막 캔들의 종가
}
if Time==083500 and 조건1 Then
{
b14=1;
b14i1=Index;
}
if b14==1 and Time==083500 and 조건2 Then
{
b14=2;
b14i2=Index;
b14매수=저점프리장-진폭프리장; #프리장저점부터 프리장진폭만큼 빠진 자리.
}
if b14==2 and Index-b14i2<=5 and L<b14매수 Then
{
b14=3;
#이 자리에서 선긋기를 하면 선긋기는 되는데 매수 실행이 안되는 경우가 있습니다.
이유가 'L<b14매수'가 완성된 종가 이후 다시 그 자리에 가지 않아서인가요? 바로 진
입이 되게 하려면 'L<b14매수'를 넣으면 안되는건가요?
Buy("b14매수",AtLimit,b14매수);
}
2024-07-25
722
글번호 181829
시스템
답변완료
파라볼릭 쌍바닥 조건
Input : af(0.02), maxAF(0.2);
var :cSarv(0), T(0),B(0),S(0),tx(0),HH(0),LL(0),box(0),TL(0);
var : Z(0),dd(0),tt(0);
var1 = CSar(af,maxAF);
plot1(var1, "CSAR",IFF(c>var1,Red,Blue));
cSarv = csar(af,maxAF);
If crossup(c,cSarv) Then
{
var1 = cSarv;
Var2 = var1[1];
if var1 <= var2+PriceScale*2 and var1 >= var2-PriceScale*2 and var2 > 0 Then
{
Tx = Text_New(sDate,sTime,var1-0.05,"●");
Text_SetColor(Tx,Magenta);
Text_SetStyle(Tx,2,2);
Text_SetSize(Tx,15);
}
}
If CrossDown(c,cSarv) Then
{
var3 = csarv;
Var4 = var3[1];
if var3 <= var4+PriceScale*1 and var3 >= var4-PriceScale*1 and var4 > 0 Then
{
Tx = Text_New(sDate,sTime,var3+0.05,"●");
Text_SetColor(Tx,Blue);
Text_SetStyle(Tx,2,2);
Text_SetSize(Tx,15);
}
}
var5 = CSar(af,maxAF);
if CrossUp(C,var5) Then
{
T = 1;
B = var5;
HH = H;
dd = sDate;
tt = sTime;
box = Box_New(sDate,sTime,B,NextBarSdate,NextBarStime,HH);
}
if CrossDown(C,var5) Then
{
T = -1;
S = var5;
LL = L;
dd = sDate;
tt = sTime;
box = Box_New(sDate,sTime,S,NextBarSdate,NextBarStime,LL);
}
if T == 1 Then
{
if var5 < B Then
{
B = var5;
box_SetBegin(box,dd,tt,S);
}
if H > HH Then
HH = H;
Box_SetEnd(box,NextBarSdate,NextBarStime,hh);
if HH < B+0.6 Then
{
Box_SetColor(box,Orange);
Box_SetFill(box,true,120);
}
Else if HH >= B+0.6 and HH < B+0.8 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,80);
}
Else if HH >= B+0.8 and HH < B+1.3 Then
{
Box_SetColor(box,Magenta);
Box_SetFill(box,true,60);
}
Else if HH >= B+1.3 and HH < B+1.9 Then
{
Box_SetColor(box,Gray);
Box_SetFill(box,true,60);
}
Else
{
Box_SetColor(box,Pink);
Box_SetFill(box,true,90);
}
}
if T == -1 Then
{
if var5 > S Then
{
S = var5;
box_SetBegin(box,dd,tt,S);
}
if L < LL Then
LL = L;
Box_SetEnd(box,NextBarSdate,NextBarStime,LL);
if LL > S-0.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.6 and ll > S-0.8 Then
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,150);
}
Else if LL <= S-0.8 and ll > S-1.3 Then
{
Box_SetColor(box,Lime);
Box_SetFill(box,true,120);
}
Else if LL <= S-1.3 and ll > S-1.6 Then
{
Box_SetColor(box,Cyan);
Box_SetFill(box,true,90);
}
Else if LL <= S-1.6 and ll > S-1.9 Then
{
Box_SetColor(box,Blue);
Box_SetFill(box,true,30);
}
Else
{
Box_SetColor(box,Yellow);
Box_SetFill(box,true,120);
}
}
쌍바닥 쌍봉 수식에 단순하게 박스 수식을 더했더니, 쌍바닥에 오류가 많이 나옵니다.
수정 부탁 드립니다.
추가로 쌍바닥 쌍봉 조건을,
직전 100개 봉의 최고가에서, 0.8 아래에서만 동그라미 표시로 수정. (H100-0.8)
쌍봉은 반대로 직전 100개 봉의 최저가에서, 0.8 위에서만 쌍봉일 때 표시. 감사합니다.
2024-07-24
917
글번호 181825
지표