커뮤니티
문의 합니다
2018-10-22 18:10:11
231
글번호 122927
1번 시스템 수식
input : 시작시간(090000),종료시간(152000);
input : Period15(15),Period20(20),Period30(30),Period120(120),Period180(180),Period240(240),Period480(480),Period960(960),Period60(60),Period3(3),Period10(10),Period2(2),Period7(7),Period144(144),Period100(100),익절틱수(10),손절틱수(10);
var : mav15(0),mav20(0),mav30(0),mav120(0),mav180(0),mav240(0),mav480(0),mav960(0),mav60(0),mav1(0),mav3(0),mav10(0),mav2(0),mav7(0),mav144(0),mav100(0),Bxcond(false),Sxcond(false);
var : Tcond(false);
var : T(0);
mav15 = ma(c, Period15);
mav20 = ma(c, Period20);
mav30 = ma(c, Period30);
mav120 = ma(c, Period120);
mav180 = ma(c, Period180);
mav240 = ma(c, Period240);
mav480 = ma(c, Period480);
mav960 = ma(c, Period960);
mav60 = ma(c, Period60);
mav3 = ma(c, Period3);
mav10 = ma(c, Period10);
mav2 = ma(c, Period2);
mav7 = ma(c, Period7);
mav144 = ma(c, Period144);
mav100 = ma(c, Period100);
if (sdate != sdate[1] and stime >= 시작시간) or
(sdate == sdate[1] and (Stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간))) Then
{
Tcond = True;
BXcond = false;
SXcond = false;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if TotalTrades > TotalTrades[1] then{
BXcond = false;
SXcond = false;
if (IsExitName("bl",0) == true or IsExitName("bp",0) == true or IsExitName("bx",1) == true or IsExitName("bx",1) == true) Then
BXcond = true;
if (IsExitName("sl1",0) == true or IsExitName("sp1",0) == true or IsExitName("sx",1) == true or IsExitName("sx",1) == true) Then
SXcond = true;
}
if Tcond == true then{
if MarketPosition <= 0 and Bxcond == false and
(mav144[1] < mav144 and mav60[60] > mav60[2] and mav60[2] <= mav60[1] and mav60[1] < mav60 and mav15[1] < mav15) Then{
buy("매수",OnClose,def,1);
}
if MarketPosition == 1 Then{
if mav15[1] < mav15 and mav7 > mav15 and mav15 > mav30 and mav30[1] < mav30 and crossup(mav2, mav3) and CurrentContracts < 10 Then
buy("매수1",OnClose,def,1);
}
if MarketPosition == 1 Then{
if (mav100[2] >= mav100[1] and mav100[1] > mav100) Then
exitlong("수청산",OnClose,def,"매수");
if (mav100[2] >= mav100[1] and mav100[1] > mav100) Then
exitlong("수청산1",OnClose,def,"매수1");
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*익절틱수);
ExitLong("bl",AtStop,AvgEntryPrice-PriceScale*손절틱수);
}
if MarketPosition >= 0 and Sxcond == false and
(mav144[1] > mav144 and mav60[60] < mav60[2] and mav60[2] >= mav60[1] and mav60[1] > mav60 and mav15[1] > mav15) Then{
sell("매도",OnClose,def,1);
}
if MarketPosition == -1 then{
if mav15[1] > mav15 and mav7 < mav15 and mav15 < mav30 and mav30[1] > mav30 and CrossDown(mav2, mav3) and CurrentContracts < 10 Then
sell("매도1",OnClose,def,1);
}
if MarketPosition == -1 then{
if (mav100[2] <= mav100[1] and mav100[1] < mav100) Then
ExitShort("도청산",OnClose,def,"매도");
if (mav100[2] <= mav100[1] and mav100[1] < mav100) Then
ExitShort("도청산1",OnClose,def,"매도1");
ExitShort("sp",atlimit,AvgEntryPrice-PriceScale*익절틱수);
ExitShort("sl",AtStop,AvgEntryPrice+PriceScale*손절틱수);
}
}
2번 시스템 수식
input : ntime1(20),P(20);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),sum1(0),mav1(0),mav11(0),mav12(0);
Array : C1[50](0);
if Bdate != Bdate[1] Then{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%ntime1;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
for cnt = 1 to 49
{
C1[cnt] = C1[cnt-1][1];
}
mav11 = mav1[1];
mav12 = mav11[1];
}
C1[0] = C;
if C1[P] > 0 then{
sum1 = 0;
for cnt = 0 to P-1{
sum1 = sum1+C1[cnt];
}
mav1 = sum1/P;
if mav12 < mav11 and mav11 < mav1 and mav12 > 0 Then
buy();
if mav12 > mav11 and mav11 > mav1 and mav12 > 0 Then
sell();
}
}
1번 수식에 2번 수식 함께 적용하여 하나의 수식으로 합쳐주세요 감사합니다
1번 수식에 최초 매수진입할 때 2번 수식 매수진입 수식을 합쳐주세요
(즉 1번 최초 매수진입과 1번 매수진입 만족하면 매수 진입)
mav144[1] < mav144 and mav60[60] > mav60[2] and mav60[2] <= mav60[1] and mav60[1] < mav60 and mav15[1] < mav15 and mav12 < mav11 and mav11 < mav1 and mav12 > 0
1번 수식에 최초 매도진입할 때 2번 수식 매도진입 수식을 합쳐주세요
(즉 1번 최초 매도진입과 1번 매도진입 만족하면 매도 진입)
mav144[1] > mav144 and mav60[60] < mav60[2] and mav60[2] >= mav60[1] and mav60[1] > mav60 and mav15[1] > mav15 and mav12 > mav11 and mav11 > mav1 and mav12 > 0
답변 1
예스스탁 예스스탁 답변
2018-10-23 12:49:14
안녕하세요
예스스탁입니다.
input : 시작시간(090000),종료시간(152000);
input : Period15(15),Period20(20),Period30(30),Period120(120),Period180(180),Period240(240),Period480(480),Period960(960),Period60(60),Period3(3),Period10(10),Period2(2),Period7(7),Period144(144),Period100(100),익절틱수(10),손절틱수(10);
var : mav15(0),mav20(0),mav30(0),mav120(0),mav180(0),mav240(0),mav480(0),mav960(0),mav60(0),mav1(0),mav3(0),mav10(0),mav2(0),mav7(0),mav144(0),mav100(0),Bxcond(false),Sxcond(false);
var : Tcond(false);
var : T(0);
input : ntime1(20),P(20);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),sum1(0),tmav1(0),tmav11(0),tmav12(0);
Array : C1[50](0);
if Bdate != Bdate[1] Then{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%ntime1;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
for cnt = 1 to 49
{
C1[cnt] = C1[cnt-1][1];
}
tmav11 = tmav1[1];
tmav12 = tmav11[1];
}
C1[0] = C;
if C1[P] > 0 then{
sum1 = 0;
for cnt = 0 to P-1{
sum1 = sum1+C1[cnt];
}
tmav1 = sum1/P;
}
}
mav15 = ma(c, Period15);
mav20 = ma(c, Period20);
mav30 = ma(c, Period30);
mav120 = ma(c, Period120);
mav180 = ma(c, Period180);
mav240 = ma(c, Period240);
mav480 = ma(c, Period480);
mav960 = ma(c, Period960);
mav60 = ma(c, Period60);
mav3 = ma(c, Period3);
mav10 = ma(c, Period10);
mav2 = ma(c, Period2);
mav7 = ma(c, Period7);
mav144 = ma(c, Period144);
mav100 = ma(c, Period100);
if (sdate != sdate[1] and stime >= 시작시간) or
(sdate == sdate[1] and (Stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간))) Then
{
Tcond = True;
BXcond = false;
SXcond = false;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if TotalTrades > TotalTrades[1] then
{
BXcond = false;
SXcond = false;
if (IsExitName("bl",0) == true or IsExitName("bp",0) == true or IsExitName("bx",1) == true or IsExitName("bx",1) == true) Then
BXcond = true;
if (IsExitName("sl1",0) == true or IsExitName("sp1",0) == true or IsExitName("sx",1) == true or IsExitName("sx",1) == true) Then
SXcond = true;
}
if Tcond == true then{
if MarketPosition <= 0 and Bxcond == false and
(mav144[1] < mav144 and mav60[60] > mav60[2] and mav60[2] <= mav60[1] and mav60[1] < mav60 and mav15[1] < mav15) and
tmav12 < tmav11 and tmav11 < tmav1 and tmav12 > 0 Then{
buy("매수",OnClose,def,1);
}
if MarketPosition == 1 Then{
if mav15[1] < mav15 and mav7 > mav15 and mav15 > mav30 and mav30[1] < mav30 and crossup(mav2, mav3) and CurrentContracts < 10 Then
buy("매수1",OnClose,def,1);
}
if MarketPosition == 1 Then{
if (mav100[2] >= mav100[1] and mav100[1] > mav100) Then
exitlong("수청산",OnClose,def,"매수");
if (mav100[2] >= mav100[1] and mav100[1] > mav100) Then
exitlong("수청산1",OnClose,def,"매수1");
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*익절틱수);
ExitLong("bl",AtStop,AvgEntryPrice-PriceScale*손절틱수);
}
if MarketPosition >= 0 and Sxcond == false and
(mav144[1] > mav144 and mav60[60] < mav60[2] and mav60[2] >= mav60[1] and mav60[1] > mav60 and mav15[1] > mav15) and
tmav12 > tmav11 and tmav11 > tmav1 and tmav12 > 0 Then{
sell("매도",OnClose,def,1);
}
if MarketPosition == -1 then{
if mav15[1] > mav15 and mav7 < mav15 and mav15 < mav30 and mav30[1] > mav30 and CrossDown(mav2, mav3) and CurrentContracts < 10 Then
sell("매도1",OnClose,def,1);
}
if MarketPosition == -1 then{
if (mav100[2] <= mav100[1] and mav100[1] < mav100) Then
ExitShort("도청산",OnClose,def,"매도");
if (mav100[2] <= mav100[1] and mav100[1] < mav100) Then
ExitShort("도청산1",OnClose,def,"매도1");
ExitShort("sp",atlimit,AvgEntryPrice-PriceScale*익절틱수);
ExitShort("sl",AtStop,AvgEntryPrice+PriceScale*손절틱수);
}
}
즐거운 하루되세요
> 남산 님이 쓴 글입니다.
> 제목 : 문의 합니다
> 1번 시스템 수식
input : 시작시간(090000),종료시간(152000);
input : Period15(15),Period20(20),Period30(30),Period120(120),Period180(180),Period240(240),Period480(480),Period960(960),Period60(60),Period3(3),Period10(10),Period2(2),Period7(7),Period144(144),Period100(100),익절틱수(10),손절틱수(10);
var : mav15(0),mav20(0),mav30(0),mav120(0),mav180(0),mav240(0),mav480(0),mav960(0),mav60(0),mav1(0),mav3(0),mav10(0),mav2(0),mav7(0),mav144(0),mav100(0),Bxcond(false),Sxcond(false);
var : Tcond(false);
var : T(0);
mav15 = ma(c, Period15);
mav20 = ma(c, Period20);
mav30 = ma(c, Period30);
mav120 = ma(c, Period120);
mav180 = ma(c, Period180);
mav240 = ma(c, Period240);
mav480 = ma(c, Period480);
mav960 = ma(c, Period960);
mav60 = ma(c, Period60);
mav3 = ma(c, Period3);
mav10 = ma(c, Period10);
mav2 = ma(c, Period2);
mav7 = ma(c, Period7);
mav144 = ma(c, Period144);
mav100 = ma(c, Period100);
if (sdate != sdate[1] and stime >= 시작시간) or
(sdate == sdate[1] and (Stime == 시작시간 or (stime > 시작시간 and stime[1] < 시작시간))) Then
{
Tcond = True;
BXcond = false;
SXcond = false;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if TotalTrades > TotalTrades[1] then{
BXcond = false;
SXcond = false;
if (IsExitName("bl",0) == true or IsExitName("bp",0) == true or IsExitName("bx",1) == true or IsExitName("bx",1) == true) Then
BXcond = true;
if (IsExitName("sl1",0) == true or IsExitName("sp1",0) == true or IsExitName("sx",1) == true or IsExitName("sx",1) == true) Then
SXcond = true;
}
if Tcond == true then{
if MarketPosition <= 0 and Bxcond == false and
(mav144[1] < mav144 and mav60[60] > mav60[2] and mav60[2] <= mav60[1] and mav60[1] < mav60 and mav15[1] < mav15) Then{
buy("매수",OnClose,def,1);
}
if MarketPosition == 1 Then{
if mav15[1] < mav15 and mav7 > mav15 and mav15 > mav30 and mav30[1] < mav30 and crossup(mav2, mav3) and CurrentContracts < 10 Then
buy("매수1",OnClose,def,1);
}
if MarketPosition == 1 Then{
if (mav100[2] >= mav100[1] and mav100[1] > mav100) Then
exitlong("수청산",OnClose,def,"매수");
if (mav100[2] >= mav100[1] and mav100[1] > mav100) Then
exitlong("수청산1",OnClose,def,"매수1");
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*익절틱수);
ExitLong("bl",AtStop,AvgEntryPrice-PriceScale*손절틱수);
}
if MarketPosition >= 0 and Sxcond == false and
(mav144[1] > mav144 and mav60[60] < mav60[2] and mav60[2] >= mav60[1] and mav60[1] > mav60 and mav15[1] > mav15) Then{
sell("매도",OnClose,def,1);
}
if MarketPosition == -1 then{
if mav15[1] > mav15 and mav7 < mav15 and mav15 < mav30 and mav30[1] > mav30 and CrossDown(mav2, mav3) and CurrentContracts < 10 Then
sell("매도1",OnClose,def,1);
}
if MarketPosition == -1 then{
if (mav100[2] <= mav100[1] and mav100[1] < mav100) Then
ExitShort("도청산",OnClose,def,"매도");
if (mav100[2] <= mav100[1] and mav100[1] < mav100) Then
ExitShort("도청산1",OnClose,def,"매도1");
ExitShort("sp",atlimit,AvgEntryPrice-PriceScale*익절틱수);
ExitShort("sl",AtStop,AvgEntryPrice+PriceScale*손절틱수);
}
}
2번 시스템 수식
input : ntime1(20),P(20);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),sum1(0),mav1(0),mav11(0),mav12(0);
Array : C1[50](0);
if Bdate != Bdate[1] Then{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%ntime1;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF < TF[1]) Then
{
for cnt = 1 to 49
{
C1[cnt] = C1[cnt-1][1];
}
mav11 = mav1[1];
mav12 = mav11[1];
}
C1[0] = C;
if C1[P] > 0 then{
sum1 = 0;
for cnt = 0 to P-1{
sum1 = sum1+C1[cnt];
}
mav1 = sum1/P;
if mav12 < mav11 and mav11 < mav1 and mav12 > 0 Then
buy();
if mav12 > mav11 and mav11 > mav1 and mav12 > 0 Then
sell();
}
}
1번 수식에 2번 수식 함께 적용하여 하나의 수식으로 합쳐주세요 감사합니다
1번 수식에 최초 매수진입할 때 2번 수식 매수진입 수식을 합쳐주세요
(즉 1번 최초 매수진입과 1번 매수진입 만족하면 매수 진입)
mav144[1] < mav144 and mav60[60] > mav60[2] and mav60[2] <= mav60[1] and mav60[1] < mav60 and mav15[1] < mav15 and mav12 < mav11 and mav11 < mav1 and mav12 > 0
1번 수식에 최초 매도진입할 때 2번 수식 매도진입 수식을 합쳐주세요
(즉 1번 최초 매도진입과 1번 매도진입 만족하면 매도 진입)
mav144[1] > mav144 and mav60[60] < mav60[2] and mav60[2] >= mav60[1] and mav60[1] > mav60 and mav15[1] > mav15 and mav12 > mav11 and mav11 > mav1 and mav12 > 0