커뮤니티
문의드립니다
2019-07-01 21:30:40
130
글번호 129928
아래 두 전략을 합쳐서 한 전략으로 부탁드립니다
1.
Input : P1(10),p2(5),P3(12),p4(5);
input : Period1(20),Period2(10);
input : 익절틱수(20),손절틱수(40);
input : starttime(101600),endtime(173000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
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");
}
var1 = StochasticsK(P1,P2);
var2 = StochasticsK(P3,P4);
var3 = StochasticsK(Period1,Period2);
if Tcond == true then
{
if crossup(var1,var3) and var1 < 20 and var3 < 20 Then
buy("매수");
if CrossDown(var1,var3) and var1 > 80 and var3 > 80 Then
sell("매도");
if crossup(var2,var3) and var2 < 20 and var3 < 20 Then
buy("매수진입");
if CrossDown(var2,var3) and var2 > 80 and var3 > 80 Then
sell("매도진입");
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2.
input : P14(14),P3(3);
input : 익절틱수(20),손절틱수(40);
var1 = (DIPLUS(P14)-DIMINUS(P14)) / (DIPLUS(P14)+DIMINUS(P14));
var2 = ema(var1,P3);
if var1 <= -0.5 and crossup(var1,var2) Then
buy();
if var1 >= 0.5 and CrossDown(var1,var2) Then
sell();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
답변 1
예스스탁 예스스탁 답변
2019-07-02 09:28:00
안녕하세요
예스스탁입니다.
Input : P1(10),p2(5),P3(12),p4(5);
input : Period1(20),Period2(10);
input : 익절틱수(20),손절틱수(40);
input : starttime(101600),endtime(173000);
input : P14(14),P13(3);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
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");
}
var1 = StochasticsK(P1,P2);
var2 = StochasticsK(P3,P4);
var3 = StochasticsK(Period1,Period2);
var5 = (DIPLUS(P14)-DIMINUS(P14)) / (DIPLUS(P14)+DIMINUS(P14));
var6 = ema(var5,P13);
if Tcond == true then
{
if crossup(var1,var3) and var1 < 20 and var3 < 20 Then
buy("매수");
if CrossDown(var1,var3) and var1 > 80 and var3 > 80 Then
sell("매도");
if crossup(var2,var3) and var2 < 20 and var3 < 20 Then
buy("매수진입");
if CrossDown(var2,var3) and var2 > 80 and var3 > 80 Then
sell("매도진입");
}
if var5 <= -0.5 and crossup(var5,var6) Then
buy();
if var5 >= 0.5 and CrossDown(var5,var6) Then
sell();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 해피슈 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 아래 두 전략을 합쳐서 한 전략으로 부탁드립니다
1.
Input : P1(10),p2(5),P3(12),p4(5);
input : Period1(20),Period2(10);
input : 익절틱수(20),손절틱수(40);
input : starttime(101600),endtime(173000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
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");
}
var1 = StochasticsK(P1,P2);
var2 = StochasticsK(P3,P4);
var3 = StochasticsK(Period1,Period2);
if Tcond == true then
{
if crossup(var1,var3) and var1 < 20 and var3 < 20 Then
buy("매수");
if CrossDown(var1,var3) and var1 > 80 and var3 > 80 Then
sell("매도");
if crossup(var2,var3) and var2 < 20 and var3 < 20 Then
buy("매수진입");
if CrossDown(var2,var3) and var2 > 80 and var3 > 80 Then
sell("매도진입");
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2.
input : P14(14),P3(3);
input : 익절틱수(20),손절틱수(40);
var1 = (DIPLUS(P14)-DIMINUS(P14)) / (DIPLUS(P14)+DIMINUS(P14));
var2 = ema(var1,P3);
if var1 <= -0.5 and crossup(var1,var2) Then
buy();
if var1 >= 0.5 and CrossDown(var1,var2) Then
sell();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
다음글
이전글