답변완료
진짜 진짜 감사합니다. ^^
예스스탁을 알고나서 매매가 너무 편해졌어요~
삶의 질이 달아졌습니다.
너무 좋은 일을 하고계신것 같습니다. ^^
추가 요청이 있는데 구현이 될지 모르겠습니다.
감사합니다~~
트레이딩 설정에서 손절매 목표수익은 체크 해놓은 상태입니다.
60포인트 이상 익절후 본전으로 온다면 강제청산
아니라면 목표 설정 그대로 적용~ ^^
----------------------------------------------------------------------
input: position(1),vol(1);
input : StartTime(160000),EndTime(170000),N(1000),xtime(55800);
var : ST(0),Tcond(false),sumV(0),entry(0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
if MarketPosition == 0 and entry < 1 then
{
if position == 1 Then
Buy("매수1",OnClose,DEf,vol);
if position == -1 Then
Sell("매도1",OnClose,DEf,vol);
}
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
ST = sTime;
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true and V >= N and MarketPosition == 0 and entry < 1 then
{
if position == 1 Then
Buy("매수",OnClose,DEf,vol);
if position == -1 Then
Sell("매도",OnClose,DEf,vol);
}
IF Xtime > ST Then
SetStopEndofday(Xtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Xtime);
}
if (sdate != sdate[1] and stime >= ST) or
(sdate == sdate[1] and stime >= ST and stime[1] < ST) Then
{
IF Xtime <= ST Then
{
SetStopEndofday(0);
}
}
2022-02-17
933
글번호 156406
시스템
답변완료
수정 부탁드려요~ ㄳㄳ
청산시 재진입 금지, 종료 시켜주세요~ (1회 제한)
감사합니다. ^^
-------------------------------------------------------------------
input: position(1),vol(1);
input : StartTime(160000),EndTime(170000),N(1000),xtime(55800);
var : ST(0),Tcond(false),sumV(0);
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
if MarketPosition == 0 then
{
if position == 1 Then
Buy("매수1",OnClose,DEf,vol);
if position == -1 Then
Sell("매도1",OnClose,DEf,vol);
}
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
ST = sTime;
}
if Tcond == true and V >= N and MarketPosition == 0 then
{
if position == 1 Then
Buy("매수",OnClose,DEf,vol);
if position == -1 Then
Sell("매도",OnClose,DEf,vol);
}
IF Xtime > ST Then
SetStopEndofday(Xtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Xtime);
}
if (sdate != sdate[1] and stime >= ST) or
(sdate == sdate[1] and stime >= ST and stime[1] < ST) Then
{
IF Xtime <= ST Then
{
SetStopEndofday(0);
}
}
2022-02-17
1010
글번호 156402
시스템
답변완료
문의드립니다
안녕하세요?
아래수식이 상승형을 위한식이였는데 반대로 하락형을위한 반대식을 구합니다
감사합니다
var : sindex1(0), sindex2(0), Lindex1(0), Lindex2(0);
var : bi(0),si(0);
value1 = stochasticsD(12,5,5);
Condition1 = value1 > value1[1] and value1[1] <= value1[2];
Condition2 = L > L[1] and L[1] <= L[2];
sindex1 = MRO(Condition1,15,1);
sindex2 = MRO(Condition1,15,2);
Lindex1 = MRO(Condition2,15,1);
Lindex2 = MRO(Condition2,15,2);
if value1[sindex1+1] > value1[sindex2+1] and
L[Lindex1+1] < L[Lindex2+1] and
Condition1 and
lowest(L,5) == lowest(L,15)
then
bi = Index;
if bi > 0 and Index == bi+1 Then
buy();
////
var : sindex3(0), sindex4(0), Hindex1(0), Hindex2(0);
Condition11 = value1 < value1[1] and value1[1] >= value1[2];
Condition12 = H < H[1] and H[1] >= H[2];
sindex3 = MRO(Condition11,15,1);
sindex4 = MRO(Condition11,15,2);
Hindex1 = MRO(Condition12,15,1);
Hindex2 = MRO(Condition12,15,2);
if value1[sindex3+1] < value1[sindex4+1] and
H[Hindex1+1] > H[Hindex2+1] and
Condition11 and
Highest(H,5) == Highest(H,15)
then
si = Index;
if Index == si+1 Then
sell();
2022-02-17
1200
글번호 156395
시스템
답변완료
BarsSinceEntry, EntryPrice는 검색식에서 사용 불가인가요??
검색식에서 진입가를 쓸려면 어떤 수식을 사용해야 하나요??
일일이 계산해서 사용하는 방법말고 없을까요?
책에 나온 전략식입니다.싸이보스 이용한 식입니다.
input: len(0.3), len1(0.02)
Var1= highd(1)-lowd(1) ‘전일 Range를 var1에 입력
If ttime<1500 then ‘시간이 15시00분 보다 적으면
Call buy("매수", Atstop, Def, opend+Var1*len) ‘금일 시가 + range*len 돌파시 매수
Call sell("매도", Atstop, Def, opend-Var1*len) ‘금일 시가-range*len 돌파시 매도
End If
If position <>0 Then '현재 포지션이 없지 않다면, 1=매수 포지션, -1 = 매도 포지션
Call exitlong("추적스탑”, Atstop, hhv(1,high, barnumsinceEntry+1)*(1-len1))
'매수 이후 최고 고가 대비 일정 비율 하락하면 청산하라
Call exitshort("추적스탑", Atstop, llv(1,low, barnumsinceEntry+1)*(1+len1))
'매도 이후 최고 저가 대비 일정 비율 상승하면 청산 하라
End If
예스트레이더로 변환한 전략식은
input : len(0.3), len1(0.02);
var1 = dayhigh(1)-dayLow(1); //전일 range를 var1에 저장
if stime < 150000 then {
buy("매수", atstop, dayOpen(0)+var1*len); //금일시가+range*len 돌파시 매수
sell("매도",atstop, dayOpen(0)-var1*len); //금일시가-Rang*len 돌파시 매도
}
if MarketPosition <> 0 then {
exitlong("매수추적스탑", atstop, highest(H,BarsSinceEntry+1)*(1-len1));
//매수 이후 최고 고가 대비 일정 비율 하락하면 청산하라
exitshort("매도추적스탑",atstop, lowest(L,BarsSinceEntry+1)*(1+len1));
//매도 이후 최고 저가 대비 일정 비율 상승하면 청산하라
}
아래는 싸이보스 검색식(신호)입니다.
Input: len(0.3), len1(0.02)
Var1=highd(1)-lowd(1)
Call plots1("매수라인", opend+Var1*len)
Call plots2("매도라인", opend-Var1*len)
If i_position=1 Then '1=매수 포지션
Call plots3("추적스탑”, hhv(1,high,i_barnumsinceEntry+1)*(1-len1))
'매수 이후 최고가 대비 2%하락시 청산
End If
If i_position=-1 Then '-1=매도 포지션
Call plots3("추적스탑", llv(1,low,i_barnumsinceEntry+1)*(1+len1))
'매도 이후 최저가 대비 2% 상승시 청산
End If
예스트레이더에 맞게 검색식은 어떻게 작성해야 할까요???
2022-02-17
1105
글번호 156393
검색
답변완료
문의드립니다.
안녕하세요,
아래와 같이 수익 청산 및 손절 관련해서 수식을 넣어놓았는데,
언젠가부터 항상 목표가, 손절가 도달 전에 청산이 되어버립니다.
뭐가 문제일까요?
나스닥 기준 8포인트 도달 시 익절, -8포인트 도달 시 손절입니다.
-----------
윗부분 생략
If CrossUp(High, mav) Then
Buy("매수",AtLimit,mav);
SetStopLoss(PriceScale*8,PointStop);
SetStopProfittarget(PriceScale*8,PointStop) ;
2022-02-17
972
글번호 156389
사용자 함수
답변완료
문의
데이트레이딩
보조차트 data2,3,4 활용
연결옵션차트는 전일 코스피200종가 기준이므로 갭보정하는 수식입니다.
var : w(0,Data1),x(0,Data1),y(0,Data1);
var : w2(0,Data1),x3(0,Data1),y4(0,Data1);
w= data2(c)-data2(c[1]);
w2 = data2(c[1])+w;
x= data3(c)-data3(c[1]);
x3 = data3(c[1])+x;
y= data4(c)-data4(c[1]);
y4 = data4(c[1])+y;
어제 종가 수식을 바르게 한 것인지요.
2022-02-17
1164
글번호 156382
시스템
답변완료
수식 보완 부탁드려요~~~
아래 수식은 지금 사용하고 있는 수식인데요..
제가 하고 싶은 것은 다음과 같습니다.
"
if MarketPosition == 0 and MoneyFlow <= MFI값 and C <= Highest(H,X)*(1-Y/100) and c<c[MFI기간]
"
원래는 위 수식조건이 만족할때 진입되는 거자나요,,,, 근데 저는 저 조건에 만족하는
시점에서 -3% 하락하는 포인트에서 매수진입하고 싶거든요....
그래서
진입조건에 아래와 같이 했는데
Buy("매수",AtLimit,c*(1-3/100));
진입되는 횟수가 너무 적어서 고믾을 해보니 매수 조건을 만족하는 것과 동시에 -3%떨어지는 시점에도 만족되어야 매수되는 것같아서요..
제가 하고 싶은 사항은 설정된 매수조건이 되면 "그 시점"을 기준으로 -3% 하락하는 시점에 매수되는 수식을 구현하고 싶은데요
결국 진짜 매수되는 상황은 매수조건을 만족하든 안하든 매수 되는 것이지요...
어떻게 안될까요???
input : MFI기간(75),MFI값(28);
input : X(4500),Y(6);
var : MoneyFlow(0),MoneyFlow1(0);
MoneyFlow = MFI(MFI기간);
MoneyFlow1 = MFI(MFI청산기간);
if MarketPosition == 0 and MoneyFlow <= MFI값 and C <= Highest(H,X)*(1-Y/100) and c<c[MFI기간] Then
Buy("b",OnClose,DEf,1);
2022-02-17
919
글번호 156379
시스템