예스스탁
예스스탁 답변
2023-07-31 11:48:52
안녕하세요
예스스탁입니다.
input : p(600);
var : XV(0),Vol(0),cond(False);
var1 = ma(C,P);
if MarketPosition == 0 and CrossDown(C,var1) Then
{
Buy("b1",OnClose,Def,10);
Buy("b2.",AtLimit,C*0.98,20);
Buy("b3.",AtLimit,C*0.96,30);
Buy("b4.",AtLimit,C*0.94,40);
Buy("b5.",AtLimit,C*0.92,50);
Buy("b6.",AtLimit,C*0.90,60);
}
if MarketPosition == 1 Then
{
if lowest(L,BarsSinceEntry) > EntryPrice*0.98 Then
Buy("b2",AtLimit,C*0.98,20);
if lowest(L,BarsSinceEntry) > EntryPrice*0.96 Then
Buy("b3",AtLimit,C*0.96,30);
if lowest(L,BarsSinceEntry) > EntryPrice*0.94 Then
Buy("b4",AtLimit,C*0.94,40);
if lowest(L,BarsSinceEntry) > EntryPrice*0.92 Then
Buy("b5",AtLimit,C*0.92,50);
if lowest(L,BarsSinceEntry) > EntryPrice*0.90 Then
Buy("b6",AtLimit,C*0.90,60);
if CurrentContracts > CurrentContracts[1] Then
{
XV = CurrentContracts;
cond = False;
}
if C >= AvgEntryPrice*(1+1.01) and sTime == 110000 Then
{
if XV >= 100 Then
vol = Floor(XV*0.01); # 계약수가 100개 이상일때 1% 분할매도
else if XV < 100 and XV >= 50 Then
vol = Floor(XV*0.02); # 계약수가 50개~100 일때 2% 분할매도
else if XV < 50 and XV >= 20 Then
vol = Floor(XV*0.05); # 계약수가 20개~50 일때 5% 분할매도
else if XV < 20 and XV >= 10 Then
vol = Floor(XV*0.10); # 계약수가 10개~20 일때 10% 분할매도
Else
vol = Floor(XV*0.50); # 계약수가 10개이하 일때 50% 분할매도
ExitLong("bx",OnClose,Def,"",vol,2);
}
}
Else
cond = False;
즐거운 하루되세요
> 이형지 님이 쓴 글입니다.
> 제목 : 국내주식 매매 수식부탁드림니다. (하락시마다 분할 매수 수식 요청)
> 기존 매도 수식을 반영해서 매수 수식과 매도 수식을 알려주심 감사하겠습니다.
주식:삼성전자
차트:60분봉
매수 조건
하락할때 일정 분할 매수 전략
해당 조건에 추가매수 1회만 진행 (같은 조건에서 추가로 매수되지 않게 )
예를 들어 매수가에 -2%하락시 20주 매수 후 상승후 또 -2%하락할때 추가로 매수되지 않게
1. 현재가가 이동평균선 600분봉(변수로 지정요청) 이하일때 10주 매수
2. 최초 매수가에서 -2% 하락할때 20주 매수
3. 최초 매수가에서 -4% 하락할때 30주 매수
4. 최초 매수가에서 -6% 하락할때 40주 매수
5. 최초 매수가에서 -8% 하락할때 50주 매수
6. 최초 매수가에서 -10% 하락할때 60주 매수
매도 조건
수익구간마다 일정청산 버전 .. 아래 수식 적용
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
XV = CurrentContracts;
cond = False;
}
if C >= AvgEntryPrice*(1+1.01) and sTime == 110000 Then
{
if XV >= 100 Then
vol = Floor(XV*0.01); # 계약수가 100개 이상일때 1% 분할매도
else if XV < 100 and XV >= 50 Then
vol = Floor(XV*0.02); # 계약수가 50개~100 일때 2% 분할매도
else if XV < 50 and XV >= 20 Then
vol = Floor(XV*0.05); # 계약수가 20개~50 일때 5% 분할매도
else if XV < 20 and XV >= 10 Then
vol = Floor(XV*0.10); # 계약수가 10개~20 일때 10% 분할매도
Else
vol = Floor(XV*0.50); # 계약수가 10개이하 일때 50% 분할매도
ExitLong("bx",OnClose,Def,"",vol,2);
}
}
Else
cond = False;