답변완료
봉개수 표시
아래는 예전 글 수식인데요.
이식에서
상승시에는 이전봉[1] 보다 고가가 높은 경우에만 봉개수를 세고
하락시에는 이전봉[1] 보다 저가가 낮은 경우에만 봉개수를 세서 표시하고 싶습니다.
---------------------------------------------------------------------------------
안녕하세요
예스스탁입니다.
input : Left(5),Right(5);
var : T(0),upi(0),dni(0),tx(0);
if T <= 0 and SwingHigh(1,H,Left,Right,Left+Right+1) != -1 Then{
var1 = H[right];
upi = index[right];
T = 1;
if upi > 0 and dni > 0 Then
{
var2 = upi-dni;
var3 = Floor(var2/2);
tx = Text_New(sdate[var3],stime[var3],var1,NumToStr(var2,0));
Text_SetStyle(tx,2,2);
}
}
if T >= 1 and SwingLow(1,L,Left,Right,Left+Right+1) != -1 Then{
var1 = L[right];
Dni = index[right];
T = -1;
if upi > 0 and dni > 0 Then
{
var2 = dni-upi;
var3 = Floor(var2/2);
tx = Text_New(sdate[var3],stime[var3],var1,NumToStr(var2,0));
Text_SetStyle(tx,2,2);
}
}
if T == 1 Then
plot1(var1,"고저점",RED);
Else
plot1(var1,"고저점",blue);
즐거운 하루되세요
> 리턴 님이 쓴 글입니다.
> 제목 : 전저/전고 사이의 봉개수 세기 표시
> 안녕하세요?
틱 차트에서 Swinghigh, Swinglow (left=5, right=5)를 이용하여 전고(천정)와 전저(바닥)가 "교대로" 나타나도록 표시하고자 합니다. (예를 들어 SwingHigh 또는 SwingLow가 연달아 두 번 나오는 경우 두 번 째 것은 배제)
또한 전저와 전고 사이의 "봉개수 세기"를 Text_new 함수를 사용하여 전고/전저 사이에 표시하고 싶습니다.
수식을 부탁합니다.
감사합니다.
2020-11-04
827
글번호 143609
지표
답변완료
문의
예전에 답변주신 수식인데 좀 지나서 문의드립니다.
- buy 수식에서
b1 진입은 X1 에 연결되어 exitlong(bx1)으로 청산됩니다.
b2 진입부터는 X2 에 연결되어 exitlong(bx2)로 청산하는 수식이지만
b2 청산결과가 이상하게 exitlong(bx1)으로 표시됩니다.
b2 진입부터는 X2에 따라 exitlong(bx2) 수식이 적용되어
청산결과도 exitlong(bx2)가 표시될 수 있게 수식을 수정바랍니다.
- sell 수식에서
b1 진입은 X1 에 연결되어 exitshort(sx1)으로 청산됩니다.
b2 진입부터는 X2 에 연결되어 exitshort(sx2)로 청산하는 수식이지만
b2 청산결과가 이상하게 exitshort(sx1)으로 표시됩니다.
b2 진입부터는 X2에 따라 exitshort(sx2) 수식이 적용되어
청산결과도 exitshort(sx2)가 표시될 수 있게 수식을 수정바랍니다.
****************************************************************************************
1) buy 수식
input : 진입시간(090000),진입제한시간(140000);
input : b1(20),b2(30),X1(20),X2(30),진입눌림(20),진입돌파(30),청산눌림(20),청산돌파(30),거래횟수(100) ;
var : T1(0),entry(0),LL(0),EH(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then{
T1 = TotalTrades;
E1 = 0;
LL = L;
}
if stime >= 진입시간 then{
if L < LL Then
LL = L;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 Then{
if E1 == 0 and C >= LL+PriceScale*B1 and C[1] < LL+PriceScale*B1 Then{
E1 = 1;
H1 = H;
i1 = index;
V1 = LL; //시작점 종가
}
if E1 == 1 and index > i1 then{
if H > H1 Then
H1 = H;
#저가가 시작봉종가보다 클때만 눌림체크
if L >= V1 and L <= H1-PriceScale*진입눌림 Then{
E1 = 2;
i1 = index;
S1 = H1;
}
}
//시작점 종가보다 낮은 가격이 발생하면 초기화
if E1 >= 1 and L < V1 Then{
E1 = 0;
LL = L;
}
if E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파 and Tcond == true Then{
buy("b1");
}
}
if TotalTrades > TotalTrades[1] Then{
E1 = 0;
LL = L;
}
if L < LL Then
LL = L;
if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{
if E1 == 0 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2 Then{
E1 = 1;
H1 = H;
i1 = index;
V1 = LL; //시작점 종가
}
if E1 == 1 and index > i1 then{
if H > H1 Then
H1 = H;
#저가가 시작봉종가보다 클때만 눌림체크
if L >= V1 and L <= H1-PriceScale*진입눌림 Then{
E1 = 2;
i1 = index;
S1 = H1;
}
}
//시작점 종가보다 낮은 가격이 발생하면 초기화
if E1 >= 1 and L < V1 Then{
E1 = 0;
LL = L;
}
if E1 == 2 and index > i1 and C >= S1+PriceScale*진입돌파 and Tcond == true Then{
buy("b2");
}
}
if MarketPosition == 1 Then{
if entry >= 1 then{
if CurrentContracts > CurrentContracts[1] Then{
EH = H;
E1 = 0;
}
if H > EH Then{
EH = H;
E1 = 0;
}
if E1 == 0 and C <= EH-PriceScale*X1 Then{
E1 = 1;
L1 = L;
i1 = index;
}
if E1 == 1 and index > i1 Then{
if L < L1 Then
L1 = L;
if H >= L1+PriceScale*청산눌림 Then{
E1 = 2;
I1 = index;
S1 = L1;
}
}
if E1 == 2 and index > i1 and C <= S1-PriceScale*청산돌파 Then{
exitlong("bx1");
E1 = 0;
}
}
}
if MarketPosition == 1 Then{
if entry >= 1 then{
if CurrentContracts > CurrentContracts[1] Then{
EH = H;
E1 = 0;
}
if H > EH Then{
EH = H;
E1 = 0;
}
if E1 == 0 and C <= EH-PriceScale*X2 Then{
E1 = 1;
L1 = L;
i1 = index;
}
if E1 == 1 and index > i1 Then{
if L < L1 Then
L1 = L;
if H >= L1+PriceScale*청산눌림 Then{
E1 = 2;
I1 = index;
S1 = L1;
}
}
if E1 == 2 and index > i1 and C <= S1-PriceScale*청산돌파 Then{
exitlong("bx2");
E1 = 0;
}
}
}
}
2) sell 수식
input : 진입시간(090000),진입제한시간(140000);
input : b1(20),b2(30),X1(20),X2(30),진입눌림(20),진입돌파(30),청산눌림(20),청산돌파(30),거래횟수(100);
var : T1(0),entry(0),HH(0),LL(0),EH(0),EL(0),E1(0),H1(0),i1(0),S1(0),L1(0),V1(0);
var : Tcond(false);
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then
Tcond = true;
if (sdate != sdate[1] and stime >= 진입제한시간) or
(sdate == sdate[1] and stime >= 진입제한시간 and stime[1] < 진입제한시간) Then
Tcond = false;
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) Then{
T1 = TotalTrades;
E1 = 0;
HH = H;
}
if stime >= 진입시간 then{
if H > HH Then
HH = H;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 Then{
if E1 == 0 and C <= HH-PriceScale*B1 and C[1] < HH-PriceScale*B1 Then{
E1 = 1;
L1 = L;
i1 = index;
V1 = HH; //시작점 종가
}
if E1 == 1 and index > i1 then{
if L < L1 Then
L1 = L;
#고가가 시작봉종가보다 작을 때만 눌림체크
if H <= V1 and H >= L1+PriceScale*진입눌림 Then{
E1 = 2;
i1 = index;
S1 = L1;
}
}
//시작점 종가보다 높은 가격이 발생하면 초기화
if E1 >= 1 and H > V1 Then{
E1 = 0;
HH = H;
}
if E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파 and Tcond == true Then{
sell("s1");
}
}
if TotalTrades > TotalTrades[1] Then{
E1 = 0;
HH = H;
}
if H > HH Then
HH = H;
if MarketPosition == 0 and entry >= 1 and entry < 거래횟수 Then{
if E1 == 0 and C <= HH-PriceScale*B2 and C[1] < HH-PriceScale*B2 Then{
E1 = 1;
L1 = L;
i1 = index;
}
if E1 == 1 and index > i1 then{
if L < L1 Then
L1 = L;
if H >= L1+PriceScale*진입눌림 Then{
E1 = 2;
i1 = index;
S1 = L1;
}
}
if E1 == 2 and index > i1 and C <= S1-PriceScale*진입돌파 and Tcond == true Then{
sell("s2");
E1 = 0;
}
}
if MarketPosition == -1 Then{
if entry >= 1 then{
if CurrentContracts > CurrentContracts[1] Then{
EL = L;
E1 = 0;
}
if L < EL Then{
EL = L;
E1 = 0;
}
if E1 == 0 and C >= EL+PriceScale*X1 Then{
E1 = 1;
H1 = H;
i1 = index;
}
if E1 == 1 and index > i1 Then{
if H > H1 Then
H1 = H;
if L <= H1-PriceScale*청산눌림 Then{
E1 = 2;
I1 = index;
S1 = H1;
}
}
if E1 == 2 and index > i1 and C >= S1+PriceScale*청산돌파 Then{
ExitShort("sx1");
E1 = 0;
}
}
}
if MarketPosition == -1 Then{
if entry >= 1 then{
if CurrentContracts > CurrentContracts[1] Then{
EL = L;
E1 = 0;
}
if L < EL Then{
EL = L;
E1 = 0;
}
if E1 == 0 and C >= EL+PriceScale*X2 Then{
E1 = 1;
H1 = H;
i1 = index;
}
if E1 == 1 and index > i1 Then{
if H > H1 Then
H1 = H;
if L <= H1-PriceScale*청산눌림 Then{
E1 = 2;
I1 = index;
S1 = H1;
}
}
if E1 == 2 and index > i1 and C >= S1+PriceScale*청산돌파 Then{
ExitShort("sx2");
E1 = 0;
}
}
}
}
2020-11-04
637
글번호 143607
시스템
답변완료
문의 드립니다
안녕하세요~
늘 애써주셔서 감사할 따름입니다.
우선 지표인지, 시스템인지 잘 몰라 시스템으로 체크했습니다.
1. 분봉 캔들의 고저를 4등분으로 나누어 표시하기( 분봉은 언제든지 변할수 있습니다)
예를 들면 10분봉일경우 캔들이 완성되는 순간 4등분을 (고,3/4,2/4,1/4, 저)
선으로(색 및 굵기 변화- 안되면 그냥 ) 바로 표시되었으면 합니다.
2. 이렇게 완성된 10분봉 4등분선을 그냥 10분봉 챠트에 적용해도 되지만 틱 챠트에
적용하려면 어떻게 해야 하는지 알려 주세요
(예 - 10분봉 챠트일경우는 어디에서 ~ 까지
틱 챠트적용은 전체 적용 )
감사합니다.
2020-11-04
583
글번호 143605
시스템