예스스탁
예스스탁 답변
2021-03-25 14:32:06
안녕하세요
예스스탁입니다.
Var : Price_high_100(0), Price_low_100(0), Volume_high_100(0), Cond_index(0);
var : diff(0),E1(0),E2(0),E3(0),E4(0),E5(0),LS(0),LL(0),LH(0);
var : Entry1(false),Entry2(false),Entry3(false),Entry4(false),Entry5(false);
Price_high_100 = highest(h,100); //고가
Price_low_100 = lowest(L,100); //저가
Volume_high_100 = Highest(V, 100);
#조건충족봉
if M >= 10000000000 and Price_high_100 == h and H > Price_low_100 * 2 and Volume_high_100 == v then
{
#봉번호 저장
Cond_index = Index;
#폭저장
diff = Price_high_100-Price_low_100;
#1~5차 진입가 및 손절가
E1 = (Price_high_100+Price_low_100)/2;
E2 = E1-diff*0.1;
E3 = E1-diff*0.2;
E4 = E1-diff*0.3;
E5 = E1-diff*0.4;
LS = E1-diff*0.5;
#각 진입 초기값
Entry1 = False;
Entry2 = False;
Entry3 = False;
Entry4 = False;
Entry5 = False;
Condition1 = False;
LL = L;
LH = H;
}
Else #조건충족하지 않은 봉
{
# Cond_index에 봉번호가 저장되어 있고
# 현재봉이 조건충족봉대비 100봉 이내일때
if Cond_index > 0 and Index < Cond_index+100 Then
{
#저가가 중간값이하인 봉이 발생하면 Cond_index은 0으로 초기화
if Condition1 == False and L <= E1 Then
Condition1 = true;
#조건만족봉 이후 최저가
if L < LL Then
{
LL = L;
LH = H;
}
#최저가 이후 최고가
if H > LH Then
LH = L;
#조건만족봉 이후 최저가가 E1과 E1+diff*0.1사이이고
#최저가 이후 최고가가 최저가 대비 diff*0.1이상이면
#각 진입가를 폭의 5%만큼식 낮춤
if LL > E1 and LL < E1+diff*0.1 and LH >= LL+diff*0.1 Then
{
E1 = E1-diff*0.05;
E2 = E2-diff*0.05;
E3 = E3-diff*0.05;
E4 = E4-diff*0.05;
E5 = E5-diff*0.05;
}
#3봉연속 저가가 전봉저가를 깨지 않으면 entry true
if Index >= Cond_index+3 and Cond_index > 0 and Condition1 == False and CountIf(L > L[1],3) == 3 Then
{
Entry1 = true;
Entry2 = true;
Entry3 = true;
Entry4 = true;
Entry5 = true;
}
}
}
#조건만족후 100봉이내에
if Cond_index > 0 and Index >= Cond_index and Index < Cond_index+500 Then
{
#하락해 지정한 가격들 터치하면 매수
if entry1 == true and E1 > 0 and L > E1 Then
Buy("b1",AtLimit,E1);
if entry2 == true and E2 > 0 and L > E2 Then
Buy("b2",AtLimit,E2);
if entry3 == true and E3 > 0 and L > E3 Then
Buy("b3",AtLimit,E3);
if entry4 == true and E4 > 0 and L > E4 Then
Buy("b4",AtLimit,E4);
if entry5 == true and E5 > 0 and L > E5 Then
Buy("b5",AtLimit,E5);
}
#매수진입 후
#최근진입에 때라 청산설정
#각 진입은 조건만족후 한번 발생하면 다음조건만족까지 진입불가
if MarketPosition == 1 Then
{
if LatestEntryName(0) == "b1" Then
{
ExitLong("bx1",AtLimit,E1*1.10);
entry1 = False;
}
if LatestEntryName(0) == "b2" Then
{
ExitLong("bx2",AtLimit,E1);
entry2 = False;
}
if LatestEntryName(0) == "b3" Then
{
ExitLong("bx3",AtLimit,(E1+E2)/2);
entry3 = False;
}
if LatestEntryName(0) == "b4" Then
{
ExitLong("bx4",AtLimit,E2);
entry4 = False;
}
if LatestEntryName(0) == "b5" Then
{
ExitLong("bx5",AtLimit,(E2+E3)/2);
entry5 = False;
ExitLong("bl",AtStop,LS);
}
}
즐거운 하루되세요
> 깜피 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요. 많은 가르침을 주셔서 항상 감사드립니다.
71623번 관련 추가 문의입니다.
빨간 선이 E1, 검은 선(이하, B1)이 (E1 + diff*0.1)인 경우
기준 봉 선정된 이후 E1과 B1 사이에서 diff*0.1 이상 반등이 나온 경우에는
(빨간색화살표 참고)에는 매수 가격을 낮추려고 합니다.
(반등이 나온 경우 매수가 : E1 -> (E1+E2)/2, E2->(E2+E3)/2 ~~~~~)
반등을 체크하는 수식을 부탁드립니다.
감사합니다.
오늘도 즐거운 하루 보내세요.