예스스탁
예스스탁 답변
2022-01-24 13:04:56
안녕하세요
예스스탁입니다.
1
시장가와 같은 실제 주문가격은 설정창의 매매가격에서 지정하셔야 합니다.
수식안에서는 실제 주문가격을 지정하는 부분이 없습니다.
랭귀지는 신호가 발생하는 조건만 지정합니다.
input : P(10);
input : StartTime(90000),EndTime(040000),xtime(055900);
var : Tcond(false);
IF xtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[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 (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF xtime <= starttime Then
{
SetStopEndofday(0);
}
}
var1 = RSI(P);
if Tcond == true Then
{
if MarketPosition <= 0 and CrossUp(var1,30) Then
Buy("b",OnClose,DEF,2);
if MarketPosition >= 0 and CrossDown(var1,70) Then
Sell("s",OnClose,DEF,2);
if MarketPosition == 1 and Highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*25 Then
ExitLong("bx",AtStop,Highest(h,BarsSinceEntry)-PriceScale*10);
if MarketPosition == -1 and lowest(l,BarsSinceEntry) <= EntryPrice-PriceScale*25 Then
ExitShort("sx",AtStop,lowest(l,BarsSinceEntry)+PriceScale*10);
}
SetStopLoss(PriceScale*30,PointStop);
SetStopProfittarget(PriceScale*50,PointStop);
2
인터넷접속이 끊어지거나 프로그램이 종료되어 있으면 동작하지 않으므로
프로그램이 실행되고 있어야 동작합니다.
별도로 서버에서 동작하거나 하지 않습니다.
즐거운 하루되세요
> joinus24 님이 쓴 글입니다.
> 제목 : 수식요청드립니다.
> 안녕하세요.
아래 매매식 부탁드립니다.
도저히 혼자는 안되네요. ㅠㅠ
<신규진입>
5분봉 차트에서 RSI 값이 상단기준선 70을 하향돌파하면 즉시 시장가 매도
RSI 값이 하단기준선 30을 상향돌파하면 즉시 시장가 매수
<손절기준>
미결제약정의 손실이 30틱이 되면 지정가 손절.
<익절기준>
이익이 50틱이 되면 지정가 익절.
다만 매수포지션 이익이 25틱이상인 구간에서 최고가 대비 10틱 하락하면 시장가 청산.
반대로, 매도포지션 이익이 25틱이상인 구간에서 최저가 대비 10틱 반등하면 시장가 청산.
<제약조건>
신규진입수량은 2개로 한정
거래일 오전9시~익일 오전4시에만 신규진입 허용.
익일 오전5시 59분 미결제약정 시장가 청산.
그리고, 개인피시를 끈다든지, 인터넷접속이 끊어지면
자동매매 걸어놓은 것은 어떻게 되는지요?
감사합니다.
joinus24
2022-01-24 13:37:21
3일 고민해도 안되는거를 깔끔하게 정리해주셨네요. 정말 감사합니다.
만약 손절났을 때 신규진입을 40분동안 막으려면 어떤 수식을 추가해야할까요?
그리고, 하루 3회 손절나면 그날 거래를 막고싶습니다.
빠른 답변 고맙습니다. 늘 건강하세요.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식요청드립니다.
>
안녕하세요
예스스탁입니다.
1
시장가와 같은 실제 주문가격은 설정창의 매매가격에서 지정하셔야 합니다.
수식안에서는 실제 주문가격을 지정하는 부분이 없습니다.
랭귀지는 신호가 발생하는 조건만 지정합니다.
input : P(10);
input : StartTime(90000),EndTime(040000),xtime(055900);
var : Tcond(false);
IF xtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[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 (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF xtime <= starttime Then
{
SetStopEndofday(0);
}
}
var1 = RSI(P);
if Tcond == true Then
{
if MarketPosition <= 0 and CrossUp(var1,30) Then
Buy("b",OnClose,DEF,2);
if MarketPosition >= 0 and CrossDown(var1,70) Then
Sell("s",OnClose,DEF,2);
if MarketPosition == 1 and Highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*25 Then
ExitLong("bx",AtStop,Highest(h,BarsSinceEntry)-PriceScale*10);
if MarketPosition == -1 and lowest(l,BarsSinceEntry) <= EntryPrice-PriceScale*25 Then
ExitShort("sx",AtStop,lowest(l,BarsSinceEntry)+PriceScale*10);
}
SetStopLoss(PriceScale*30,PointStop);
SetStopProfittarget(PriceScale*50,PointStop);
2
인터넷접속이 끊어지거나 프로그램이 종료되어 있으면 동작하지 않으므로
프로그램이 실행되고 있어야 동작합니다.
별도로 서버에서 동작하거나 하지 않습니다.
즐거운 하루되세요
> joinus24 님이 쓴 글입니다.
> 제목 : 수식요청드립니다.
> 안녕하세요.
아래 매매식 부탁드립니다.
도저히 혼자는 안되네요. ㅠㅠ
<신규진입>
5분봉 차트에서 RSI 값이 상단기준선 70을 하향돌파하면 즉시 시장가 매도
RSI 값이 하단기준선 30을 상향돌파하면 즉시 시장가 매수
<손절기준>
미결제약정의 손실이 30틱이 되면 지정가 손절.
<익절기준>
이익이 50틱이 되면 지정가 익절.
다만 매수포지션 이익이 25틱이상인 구간에서 최고가 대비 10틱 하락하면 시장가 청산.
반대로, 매도포지션 이익이 25틱이상인 구간에서 최저가 대비 10틱 반등하면 시장가 청산.
<제약조건>
신규진입수량은 2개로 한정
거래일 오전9시~익일 오전4시에만 신규진입 허용.
익일 오전5시 59분 미결제약정 시장가 청산.
그리고, 개인피시를 끈다든지, 인터넷접속이 끊어지면
자동매매 걸어놓은 것은 어떻게 되는지요?
감사합니다.
예스스탁
예스스탁 답변
2022-01-24 13:54:07
안녕하세요
예스스탁입니다.
input : P(10);
input : StartTime(90000),EndTime(040000),xtime(055900);
input : 손절횟수(0);
var : Tcond(false),loss(0),X(0);
IF xtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[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 (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
X = 0;
IF xtime <= starttime Then
{
SetStopEndofday(0);
}
}
var1 = RSI(P);
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("StopLoss",1) == true Then
{
X = 1;
loss = loss+1;
}
Else
X = 0;
}
if Tcond == true and loss < 손절횟수 Then
{
if CrossUp(var1,30) Then
{
if (X == 0 and MarketPosition <= 0) or
(X == 1 and MarketPosition == 0 and TimeToMinutes(sTime) >= TimeToMinutes(ExitTime(1))+40) Then
Buy("b",OnClose,DEF,2);
}
if CrossDown(var1,70) Then
{
if (X == 0 and MarketPosition >= 0) or
(X == 1 and MarketPosition == 0 and TimeToMinutes(sTime) >= TimeToMinutes(ExitTime(1))+40) Then
Sell("s",OnClose,DEF,2);
}
if MarketPosition == 1 and Highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*25 Then
ExitLong("bx",AtStop,Highest(h,BarsSinceEntry)-PriceScale*10);
if MarketPosition == -1 and lowest(l,BarsSinceEntry) <= EntryPrice-PriceScale*25 Then
ExitShort("sx",AtStop,lowest(l,BarsSinceEntry)+PriceScale*10);
}
SetStopLoss(PriceScale*30,PointStop);
SetStopProfittarget(PriceScale*50,PointStop);
즐거운 하루되세요
> joinus24 님이 쓴 글입니다.
> 제목 : Re : Re : 수식요청드립니다.
> 3일 고민해도 안되는거를 깔끔하게 정리해주셨네요. 정말 감사합니다.
만약 손절났을 때 신규진입을 40분동안 막으려면 어떤 수식을 추가해야할까요?
그리고, 하루 3회 손절나면 그날 거래를 막고싶습니다.
빠른 답변 고맙습니다. 늘 건강하세요.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식요청드립니다.
>
안녕하세요
예스스탁입니다.
1
시장가와 같은 실제 주문가격은 설정창의 매매가격에서 지정하셔야 합니다.
수식안에서는 실제 주문가격을 지정하는 부분이 없습니다.
랭귀지는 신호가 발생하는 조건만 지정합니다.
input : P(10);
input : StartTime(90000),EndTime(040000),xtime(055900);
var : Tcond(false);
IF xtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[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 (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF xtime <= starttime Then
{
SetStopEndofday(0);
}
}
var1 = RSI(P);
if Tcond == true Then
{
if MarketPosition <= 0 and CrossUp(var1,30) Then
Buy("b",OnClose,DEF,2);
if MarketPosition >= 0 and CrossDown(var1,70) Then
Sell("s",OnClose,DEF,2);
if MarketPosition == 1 and Highest(h,BarsSinceEntry) >= EntryPrice+PriceScale*25 Then
ExitLong("bx",AtStop,Highest(h,BarsSinceEntry)-PriceScale*10);
if MarketPosition == -1 and lowest(l,BarsSinceEntry) <= EntryPrice-PriceScale*25 Then
ExitShort("sx",AtStop,lowest(l,BarsSinceEntry)+PriceScale*10);
}
SetStopLoss(PriceScale*30,PointStop);
SetStopProfittarget(PriceScale*50,PointStop);
2
인터넷접속이 끊어지거나 프로그램이 종료되어 있으면 동작하지 않으므로
프로그램이 실행되고 있어야 동작합니다.
별도로 서버에서 동작하거나 하지 않습니다.
즐거운 하루되세요
> joinus24 님이 쓴 글입니다.
> 제목 : 수식요청드립니다.
> 안녕하세요.
아래 매매식 부탁드립니다.
도저히 혼자는 안되네요. ㅠㅠ
<신규진입>
5분봉 차트에서 RSI 값이 상단기준선 70을 하향돌파하면 즉시 시장가 매도
RSI 값이 하단기준선 30을 상향돌파하면 즉시 시장가 매수
<손절기준>
미결제약정의 손실이 30틱이 되면 지정가 손절.
<익절기준>
이익이 50틱이 되면 지정가 익절.
다만 매수포지션 이익이 25틱이상인 구간에서 최고가 대비 10틱 하락하면 시장가 청산.
반대로, 매도포지션 이익이 25틱이상인 구간에서 최저가 대비 10틱 반등하면 시장가 청산.
<제약조건>
신규진입수량은 2개로 한정
거래일 오전9시~익일 오전4시에만 신규진입 허용.
익일 오전5시 59분 미결제약정 시장가 청산.
그리고, 개인피시를 끈다든지, 인터넷접속이 끊어지면
자동매매 걸어놓은 것은 어떻게 되는지요?
감사합니다.