예스스탁
예스스탁 답변
2020-02-03 15:26:55
안녕하세요
예스스탁입니다.
1
input : T(1),starttime(90000),endtime(020000);//T가0이면 시간제한없음. 1이면 시간제한
input : Profit(1),익절틱수(10); //Prorfit이 0이면 손절없음, 1이면 손절 적용
input : Loss(1),손절틱수(30); //Loss가 0이면 익절없음, 1이면 익절 적용
var : Tcond(false),line1(0),line2(0),line3(0);
#line값
line1 = ma(C,5);
line2 = ma(C,20);
line3 = ma(C,60);
if sdate != sdate[1] then
{
if T == 1 Then
SetStopEndofday(endtime);
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
SetStopEndofday(0);
}
if T == 0 or (T == 1 and Tcond == true) then
{
if crossup(line2,line3) and line1 > line2 Then
buy("b1");
if CrossDown(line2,line3) and line1 < line2 Then
sell("s1");
}
if Profit == 1 Then
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if Loss == 1 Then
SetStopLoss(PriceScale*손절틱수,PointStop);
2
input : T(1),starttime(90000),endtime(020000);//T가0이면 시간제한없음. 1이면 시간제한
input : Profit(1),익절틱수(10); //Prorfit이 0이면 손절없음, 1이면 손절 적용
input : Loss(1),손절틱수(30); //Loss가 0이면 익절없음, 1이면 익절 적용
var : Tcond(false),line1(0),line2(0);
#line값
line1 = ma(C,5);
line2 = ma(C,20);
if sdate != sdate[1] then
{
if T == 1 Then
SetStopEndofday(endtime);
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
SetStopEndofday(0);
}
if T == 0 or (T == 1 and Tcond == true) then
{
if crossup(line1,line2) Then
buy("b1");
if CrossDown(line1,line2) Then
sell("s1");
}
if Profit == 1 Then
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if Loss == 1 Then
SetStopLoss(PriceScale*손절틱수,PointStop);
2
피라미딩 다른진입신호만 허용
input : T(1),starttime(90000),endtime(020000);//T가0이면 시간제한없음. 1이면 시간제한
input : Profit(1),익절틱수(10); //Prorfit이 0이면 손절없음, 1이면 손절 적용
input : Loss(1),손절틱수(30); //Loss가 0이면 익절없음, 1이면 익절 적용
var : Tcond(false),line1(0),line2(0),line3(0);
#line값
line1 = ma(C,5);
line2 = ma(C,20);
line3 = ma(C,60);
if sdate != sdate[1] then
{
if T == 1 Then
SetStopEndofday(endtime);
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
SetStopEndofday(0);
}
if T == 0 or (T == 1 and Tcond == true) then
{
if MarketPosition <= 0 and crossup(line1,line2) Then
buy("b1");
if MarketPosition == 1 and MaxEntries ==1 and crossup(line1,line3) Then
buy("b2");
if MarketPosition == 1 and MaxEntries == 2 and crossup(line2,line3) Then
buy("b3");
if MarketPosition >= 0 and CrossDown(line1,line2) Then
sell("s1");
if MarketPosition == 1 and MaxEntries ==1 and CrossDown(line1,line3) Then
sell("s2");
if MarketPosition == 1 and MaxEntries == 2 and CrossDown(line2,line3) Then
sell("s3");
}
if Profit == 1 Then
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if Loss == 1 Then
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 이대표 님이 쓴 글입니다.
> 제목 : 시스템 수식부탁
>
수고가 많으십니다.
다음과 같은 사례에서 초보자가 예스수식을 만들고 싶은데 로직 기초단계에서부터 자세히
부탁드립니다.
<전제조건>
-1라인, 2라인, 3라인 (이평선은 아니지만 이해하기 쉽게 하기 위함)이 존재함
-전체적으로 기본손절은 10틱, 기본익절은 30틱 (익절과 손절은 본인이 선택할수 있도록 부탁. 기본 익절 손절없이 로직짜는 방법과 –10틱, 30틱 손절 익절 걸고 로직짜는 방법 선택가능)
-매매시간대는 오후9시부터 새벽2시까지만
(이 경우도 시간준수하는 경우와 시간제한 없이 할수 있도록 선택가능하도록....)
①1라인이 2라인을 상향돌파하고 2라인이 3라인을 돌파 할 때 매수신호 발생
매수청산은 1라인이 2라인을 하향돌파하고 2라인이 3라인을 하향돌파할 때
매도신호는 1라인이 2라인을 하향돌파하고 2라인이 3라인을 하향돌파할 때 발생
매도청산은 1라인이 2라인을 상향돌파하고 2라인이 3라인을 상향돌파할 때 발생
②1라인이 2라인을 상향돌파할 때 매수진입
1라인이 2라인을 하향돌파할 때 매수청산 및 매도진입
1라인이 2라인을 재상향돌파할 때 매수청산 및 매수진입
③1라인이 2라인을 상향돌파할 때 1차 매수진입
1라인이 3라인을 상향돌파할 때 2차 매수진입
2라인이 3라인을 상향돌파할 때 3차 매수진입
1라인이 2라인을 하향돌파할 때 전체 매수 올청 및 1차 매도진입
1라인이 3라인을 하향돌파할 때 2차 매도진입
2라인이 3라인을 하향돌파할 때 2차 매도진입
1라인이 2라인을 상향돌파할 때 매도 올청 및 1차 매수진입