예스스탁
예스스탁 답변
2020-02-03 15:56:46
안녕하세요
예스스탁입니다.
1
var : idx(0),hc(0),sum(0),mav(0);
if bdate != bdate[1] Then
{
Condition1 = true;
idx = 0;
sum = 0;
}
if Condition1 == true then
{
sum = sum + c;
idx = idx+1;
mav = sum/idx;
if idx == 5 Then
{
var1 = c;
Hc = C;
}
if idx>= 5 and c > hc Then
hc = c;
if MarketPosition == 0 and ExitDate(1) == sdate and idx > 5 and crossup(c,var1*1.001) and stime < 153000 Then
buy("b",OnClose,def,2);
if MarketPosition == 1 Then
{
if c < var1 Then
exitlong("bx1");
if highest(c,BarsSinceEntry) >= var1*1.01 and
C <= hc-(hc-EntryPrice)*0.5 Then
ExitLong("bx2",OnClose,def,"",1,1);
if CountIF(CrossDown(c,mav),BarsSinceEntry) >= 2 Then
ExitLong("bx3",OnClose,def,"",1,1);
if stime >= 153000 and stime[1] < 153000 Then
ExitLong("bx4");
}
}
2
var : idx(0),hc(0),sum(0),mav(0);
if bdate != bdate[1] Then
{
Condition1 = true;
idx = 0;
sum = 0;
}
if Condition1 == true then
{
sum = sum + c;
idx = idx+1;
mav = sum/idx;
if idx == 5 Then
{
var1 = c;
Hc = C;
}
if idx>= 5 and c > hc Then
hc = c;
if MarketPosition == 0 and ExitDate(1) == sdate and idx > 5 and hc >= var1*1.01 and C <= hc-(hc-var1)*0.5 and stime < 153000 Then
sell("s",OnClose,def,2);
if MarketPosition == 1 Then
{
if hc > hc[1] and Hc[1] > hc[2] Then
ExitShort("sx1");
if C < var1 and c > ma(c,60) Then
ExitShort("sx2",OnClose,def,"",1,1);
if c < var1 and C >= lowest(C,BarsSinceEntry)+(EntryPrice-lowest(C,BarsSinceEntry))*0.5 Then
ExitShort("sx3",OnClose,def,"",1,1);
if stime >= 153000 and stime[1] < 153000 Then
ExitShort("sx4");
}
}
즐거운 하루되세요
> 천장지구 님이 쓴 글입니다.
> 제목 : 추세 매매와 역추세 매매 수식 문의
> 안녕하세요.
추세 매매와 역추세 매매 수식 작성이 되지 않아 문의 드립니다.
작성 부탁 드립니다.
항상 도움 주셔서 감사합니다.
============================================================================
<추세>
기준가: 당일 5번째 봉 종가
전략: 종가가 기준가에서 0.5%이상 상승 시 종가 매수 2개
손실청산: 종가가 기준가보다 하락 시 종가 청산
중간청산1: 종가가 기준가에서 1%이상 상승 시 당일 최고 종가 기준 종가가 50%이상 하락 시 종가 청산 1개
중간청산2: 종가가 당일 누적 종가 이동평균에서 종가가 2번 연속 하락시 종가 청산 1개
당일청산: 오후 3시 30분 종가 청산
==============================================================================
<역추세>
기준가: 당일 5번째 봉 종가
전략: 종가가 기준가에서 1%이상 상승 시 당일 최고 종가 기준 종가가 50%이상 하락 시 종가 매도 2개
손실청산: 종가가 당일 2번째 최고 종가, 당일 최고 종가 연속으로 상승 시 종가 청산
중간청산1: 종가가 기준가보다 하락 하고 당일 60 종가이동평균 이상 일때 종가 청산 1개
중간청산2: 종가가 기준가에서 1%이상 하락시 당일 최저 종가 기준 종가가 50%이상 상승 시 종가 청산 1개
당일청산: 오후 3시 30분 종가 청산