커뮤니티
추가부탁드립니다
2017-09-27 21:15:48
163
글번호 113149
input : P(10),익절틱수(10);
var : MM(0),T(0);
MM = (highest(H,P)+lowest(L,P))/2;
if T == 0 and C > MM Then
T = 1;
if T == 0 and C < MM Then
T = -1;
if T == 1 and CrossDown(C,lowest(L,P)[1]) Then
T = 0;
if T == -1 and CrossUp(C,highest(H,P)[1]) Then
T = 0;
if dayindex == 0 and T == 1 then
buy();
if dayindex == 0 and T == -1 then
sell();
if dayindex > 0 then{
if T == 1 and T[1] != 1 Then
buy();
if T == 0 and T[1] == 1 Then
sell();
}
if T == -1 and T[1] != -1 Then
sell();
if T == 0 and T[1] == -1 Then
buy();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopEndofday(150000);
위 수식에 추가 바랍니다
1.원하는 틱수를 얻었을경우 매매종료 매수든 매도든
2.원하는 시간설정 시작시간10시30분 종료시간 17시
감사합니다
답변 1
예스스탁 예스스탁 답변
2017-09-28 13:51:30
안녕하세요
예스스탁입니다.
input : P(10),익절틱수(10);
Input : 시작시간(103000),종료시간(170000);
Var : Xcond(false),MM(0),T(0),Tcond(false),idx(0);
if (sdate != sdate[1] and stime >= 시작시간) or
(sdate == sdate[1] and stime >= 시작시간 and stime[1] < 시작시간) Then{
Tcond = true;
Xcond = false;
idx = 0;
}
if (sdate != sdate[1] and stime >= 종료시간) or
(sdate == sdate[1] and stime >= 종료시간 and stime[1] < 종료시간) Then{
Tcond = false;
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
if TotalTrades > TotalTrades[1] and IsExitName("StopProfitTarget",1) == true then
Xcond = true;
MM = (highest(H,P)+lowest(L,P))/2;
if Tcond == true then{
idx = idx+1;
if T == 0 and C > MM Then
T = 1;
if T == 0 and C < MM Then
T = -1;
if T == 1 and CrossDown(C,lowest(L,P)[1]) Then
T = 0;
if T == -1 and CrossUp(C,highest(H,P)[1]) Then
T = 0;
if idx == 1 and T == 1 then
buy();
if idx == 1 and T == -1 then
sell();
if idx > 1 then{
if T == 1 and T[1] != 1 Then
buy();
if T == 0 and T[1] == 1 Then
sell();
}
if T == -1 and T[1] != -1 Then
sell();
if T == 0 and T[1] == -1 Then
buy();
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
즐거운 하루되세요
> 곽민수 님이 쓴 글입니다.
> 제목 : 추가부탁드립니다
> input : P(10),익절틱수(10);
var : MM(0),T(0);
MM = (highest(H,P)+lowest(L,P))/2;
if T == 0 and C > MM Then
T = 1;
if T == 0 and C < MM Then
T = -1;
if T == 1 and CrossDown(C,lowest(L,P)[1]) Then
T = 0;
if T == -1 and CrossUp(C,highest(H,P)[1]) Then
T = 0;
if dayindex == 0 and T == 1 then
buy();
if dayindex == 0 and T == -1 then
sell();
if dayindex > 0 then{
if T == 1 and T[1] != 1 Then
buy();
if T == 0 and T[1] == 1 Then
sell();
}
if T == -1 and T[1] != -1 Then
sell();
if T == 0 and T[1] == -1 Then
buy();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopEndofday(150000);
위 수식에 추가 바랍니다
1.원하는 틱수를 얻었을경우 매매종료 매수든 매도든
2.원하는 시간설정 시작시간10시30분 종료시간 17시
감사합니다
다음글