커뮤니티
부탁합니다
2017-06-13 10:56:21
117
글번호 110361
input : Period3(3),Period6(6),Period9(5),Period10(10),Period11(20),Period12(40),Period13(80),Period14(120),Period15(160),Period16(300),Period17(600),Period18(10),익절틱수(20),손절틱수(10);
Input : Period(12),sigPeriod(9);
Input : Period50(50), maPeriod51(51);
input : Period33(12),sigPeriod34(9),Period55(50), maPeriod56(51);
var : mav3(0),mav6(0),mav9(0),mav10(0),mav11(0),mav12(0),mav13(0),mav14(0),mav15(0),mav16(0),mav17(0),mav18(0),SROC(0),SROCsig(0),SROC2(0),SROCsig2(0),Bxcond(false),Sxcond(false);
var : Tcond(false);
mav11 = ma(c, Period11);
mav17 = ma(c, Period17);
mav18 = ma(c, Period18);
value1 = TRIX(Period);
value2 = ema(value1, sigPeriod);
value50 = SONAR(Period50);
value51 = ema(value50, maPeriod51);
value3 = TRIX(Period33);
value4 = ema(value3, sigPeriod34);
value52 = SONAR(Period55);
value53 = ema(value52, maPeriod56);
if Bdate != Bdate[1] then
{
Tcond = True;
BXcond = false;
SXcond = false;
}
if TotalTrades > TotalTrades[1] then{
BXcond = false;
SXcond = false;
if (IsExitName("bl",1) == true or IsExitName("bp",1) == true or IsExitName("bx",1) == true) Then
BXcond = true;
if (IsExitName("sl",1) == true or IsExitName("sp",1) == true or IsExitName("sx",1) == true) Then
SXcond = true;
}
if MarketPosition <= 0 and
Bxcond == false and Tcond == true and
(value50 > value51 and mav17[1] < mav17) Then
buy("b",OnClose,def,1);
if MarketPosition == 1 Then{
if mav17[1] < mav17 and mav18[1] < mav18 and CurrentContracts < 2 Then
buy("bb1",OnClose,def,1);
}
if MarketPosition == 1 Then{
if mav17[1] < mav17 and mav18[3] >= mav18[2] and mav18[2] <= mav18[1] and mav18[1] < mav18 and CurrentContracts < 3 Then
buy("bb2",OnClose,def,1);
}
if MarketPosition == 1 Then{
if (CrossDown(value1,value2)) or (CrossDown(value50, value51)) or(CrossDown(value3,value4)) or (CrossDown(value52, value53)) Then{
ExitLong("bx");
}
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*익절틱수);
ExitLong("bl",AtStop,AvgEntryPrice-PriceScale*손절틱수);
}
if MarketPosition >= 0 and
Sxcond == false and Tcond == true and
(value50 < value51 and mav17[1] > mav17) Then
sell("s",OnClose,def,1);
if MarketPosition == -1 then{
if mav17[1] > mav17 and mav18[1] > mav18 and CurrentContracts < 2 Then
sell("ss1",OnClose,def,1);
}
if MarketPosition == -1 then{
if mav17[1] > mav17 and mav18[3] <= mav18[2] and mav18[2] >= mav18[1] and mav18[1] > mav18 and CurrentContracts < 3 Then
sell("ss2",OnClose,def,1);
}
if MarketPosition == -1 then{
if (crossup(value1,value2)) or (CrossUP(value50, value51)) or (crossup(value3,value4)) or (crossup(value52,value53)) Then{
ExitShort("sx");
}
ExitShort("sp",atlimit,AvgEntryPrice-PriceScale*익절틱수);
ExitShort("sl",AtStop,AvgEntryPrice+PriceScale*손절틱수);
}
위 수식에 한가지 추가하여 넣어 주세요
거래시간을 07:00 ~ 익일 05:40 그리고 익일 05:40에 모든진입 청산 진행
매매중지 시간 05:40 ~06:00 그리고 input :에 넣어 주세요
화살표도 구현할 수 있나요
답변 1
예스스탁 예스스탁 답변
2017-06-13 14:30:39
input : 시작시간(070000),종료시간(054000);
input : Period3(3),Period6(6),Period9(5),Period10(10),Period11(20),Period12(40),Period13(80),Period14(120),Period15(160),Period16(300),Period17(600),Period18(10),익절틱수(20),손절틱수(10);
Input : Period(12),sigPeriod(9);
Input : Period50(50), maPeriod51(51);
input : Period33(12),sigPeriod34(9),Period55(50), maPeriod56(51);
var : mav3(0),mav6(0),mav9(0),mav10(0),mav11(0),mav12(0),mav13(0),mav14(0),mav15(0),mav16(0),mav17(0),mav18(0),SROC(0),SROCsig(0),SROC2(0),SROCsig2(0),Bxcond(false),Sxcond(false);
var : Tcond(false);
mav11 = ma(c, Period11);
mav17 = ma(c, Period17);
mav18 = ma(c, Period18);
value1 = TRIX(Period);
value2 = ema(value1, sigPeriod);
value50 = SONAR(Period50);
value51 = ema(value50, maPeriod51);
value3 = TRIX(Period33);
value4 = ema(value3, sigPeriod34);
value52 = SONAR(Period55);
value53 = ema(value52, maPeriod56);
if Bdate != Bdate[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",1) == true or IsExitName("bp",1) == true or IsExitName("bx",1) == true) Then
BXcond = true;
if (IsExitName("sl",1) == true or IsExitName("sp",1) == true or IsExitName("sx",1) == true) Then
SXcond = true;
}
if Tcond == true then{
if MarketPosition <= 0 and
Bxcond == false and
(value50 > value51 and mav17[1] < mav17) Then
buy("b",OnClose,def,1);
if MarketPosition == 1 Then{
if mav17[1] < mav17 and mav18[1] < mav18 and CurrentContracts < 2 Then
buy("bb1",OnClose,def,1);
if mav17[1] < mav17 and mav18[3] >= mav18[2] and mav18[2] <= mav18[1] and mav18[1] < mav18 and CurrentContracts < 3 Then
buy("bb2",OnClose,def,1);
if (CrossDown(value1,value2)) or (CrossDown(value50, value51)) or(CrossDown(value3,value4)) or (CrossDown(value52, value53)) Then
ExitLong("bx");
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*익절틱수);
ExitLong("bl",AtStop,AvgEntryPrice-PriceScale*손절틱수);
}
if MarketPosition >= 0 and
Sxcond == false and
(value50 < value51 and mav17[1] > mav17) Then
sell("s",OnClose,def,1);
if MarketPosition == -1 then{
if mav17[1] > mav17 and mav18[1] > mav18 and CurrentContracts < 2 Then
sell("ss1",OnClose,def,1);
if mav17[1] > mav17 and mav18[3] <= mav18[2] and mav18[2] >= mav18[1] and mav18[1] > mav18 and CurrentContracts < 3 Then
sell("ss2",OnClose,def,1);
if (crossup(value1,value2)) or (CrossUP(value50, value51)) or (crossup(value3,value4)) or (crossup(value52,value53)) Then
ExitShort("sx");
ExitShort("sp",atlimit,AvgEntryPrice-PriceScale*익절틱수);
ExitShort("sl",AtStop,AvgEntryPrice+PriceScale*손절틱수);
}
}
> 남산 님이 쓴 글입니다.
> 제목 : 부탁합니다
> input : Period3(3),Period6(6),Period9(5),Period10(10),Period11(20),Period12(40),Period13(80),Period14(120),Period15(160),Period16(300),Period17(600),Period18(10),익절틱수(20),손절틱수(10);
Input : Period(12),sigPeriod(9);
Input : Period50(50), maPeriod51(51);
input : Period33(12),sigPeriod34(9),Period55(50), maPeriod56(51);
var : mav3(0),mav6(0),mav9(0),mav10(0),mav11(0),mav12(0),mav13(0),mav14(0),mav15(0),mav16(0),mav17(0),mav18(0),SROC(0),SROCsig(0),SROC2(0),SROCsig2(0),Bxcond(false),Sxcond(false);
var : Tcond(false);
mav11 = ma(c, Period11);
mav17 = ma(c, Period17);
mav18 = ma(c, Period18);
value1 = TRIX(Period);
value2 = ema(value1, sigPeriod);
value50 = SONAR(Period50);
value51 = ema(value50, maPeriod51);
value3 = TRIX(Period33);
value4 = ema(value3, sigPeriod34);
value52 = SONAR(Period55);
value53 = ema(value52, maPeriod56);
if Bdate != Bdate[1] then
{
Tcond = True;
BXcond = false;
SXcond = false;
}
if TotalTrades > TotalTrades[1] then{
BXcond = false;
SXcond = false;
if (IsExitName("bl",1) == true or IsExitName("bp",1) == true or IsExitName("bx",1) == true) Then
BXcond = true;
if (IsExitName("sl",1) == true or IsExitName("sp",1) == true or IsExitName("sx",1) == true) Then
SXcond = true;
}
if MarketPosition <= 0 and
Bxcond == false and Tcond == true and
(value50 > value51 and mav17[1] < mav17) Then
buy("b",OnClose,def,1);
if MarketPosition == 1 Then{
if mav17[1] < mav17 and mav18[1] < mav18 and CurrentContracts < 2 Then
buy("bb1",OnClose,def,1);
}
if MarketPosition == 1 Then{
if mav17[1] < mav17 and mav18[3] >= mav18[2] and mav18[2] <= mav18[1] and mav18[1] < mav18 and CurrentContracts < 3 Then
buy("bb2",OnClose,def,1);
}
if MarketPosition == 1 Then{
if (CrossDown(value1,value2)) or (CrossDown(value50, value51)) or(CrossDown(value3,value4)) or (CrossDown(value52, value53)) Then{
ExitLong("bx");
}
ExitLong("bp",atlimit,AvgEntryPrice+PriceScale*익절틱수);
ExitLong("bl",AtStop,AvgEntryPrice-PriceScale*손절틱수);
}
if MarketPosition >= 0 and
Sxcond == false and Tcond == true and
(value50 < value51 and mav17[1] > mav17) Then
sell("s",OnClose,def,1);
if MarketPosition == -1 then{
if mav17[1] > mav17 and mav18[1] > mav18 and CurrentContracts < 2 Then
sell("ss1",OnClose,def,1);
}
if MarketPosition == -1 then{
if mav17[1] > mav17 and mav18[3] <= mav18[2] and mav18[2] >= mav18[1] and mav18[1] > mav18 and CurrentContracts < 3 Then
sell("ss2",OnClose,def,1);
}
if MarketPosition == -1 then{
if (crossup(value1,value2)) or (CrossUP(value50, value51)) or (crossup(value3,value4)) or (crossup(value52,value53)) Then{
ExitShort("sx");
}
ExitShort("sp",atlimit,AvgEntryPrice-PriceScale*익절틱수);
ExitShort("sl",AtStop,AvgEntryPrice+PriceScale*손절틱수);
}
위 수식에 한가지 추가하여 넣어 주세요
거래시간을 07:00 ~ 익일 05:40 그리고 익일 05:40에 모든진입 청산 진행
매매중지 시간 05:40 ~06:00 그리고 input :에 넣어 주세요
화살표도 구현할 수 있나요
다음글
이전글