커뮤니티
야간매매
2013-07-04 11:09:33
172
글번호 64994
안녕하세요 야간선물 당일 6시부터 익일 4시까지 매매할려고 합니다
주간에 사용하던건데 야간에 사용할려고 합니다
수식이 맞는지 한번만 확인 부탁 드립니다 감사합니다
input : LossPoint(0.65),진입양봉갯수(3),청산양봉갯수(3),청산음봉갯수(3),
재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if (stime >= 180000 or stime < 040000) and
MarketPosition == 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1)) and
&& MAv1 > MAv2
&& MAv2 > MAv3
&& MAv3 > MAv4
&& C > MAv4
Then
{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 Then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,진입양봉갯수) == 진입양봉갯수 ) and
rebuy < 재매수횟수 and C > MAv1 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,청산양봉갯수) == 청산양봉갯수 or Countif(cond2 == true,청산음봉갯수) == 청산음봉갯수 Then
ExitLong("매수청산4");
}
if stime == 040000 or (stime > 040000 and stime[1] < 040000) Then
Exitlong();
답변 3
예스스탁 예스스탁 답변
2013-07-04 13:19:39
안녕하세요
예스스탁입니다.
18시 부터 거래가 시작되므로
초기화 시점이 date != date[1]가 아닌 18시가 되어야 합니다.
date != date[1]는 0시가 기준이 됩니다.
당일 진입횟수를 세는 부분도 변경해야 합니다.
아래 수정한식 참고하시기 바랍니다.
input : LossPoint(0.65),진입양봉갯수(3),청산양봉갯수(3),청산음봉갯수(3),
재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
#초기화
if stime == 180000 or (stime > 180000 and stime[1] < 180000) Then{
Rebuy = 0;
ReEL = 0;
count = 0;
}
#진입횟수 카운트
if (stime >= 180000 or stime < 040000) and
MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
count = count+1;
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if (stime >= 180000 or stime < 040000) and
MarketPosition == 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1))
&& MAv1 > MAv2
&& MAv2 > MAv3
&& MAv3 > MAv4
&& C > MAv4
Then
{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 and (stime >= 180000 or stime < 040000) then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,진입양봉갯수) == 진입양봉갯수 ) and
rebuy < 재매수횟수 and C > MAv1 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,청산양봉갯수) == 청산양봉갯수 or Countif(cond2 == true,청산음봉갯수) == 청산음봉갯수 Then
ExitLong("매수청산4");
}
if stime == 040000 or (stime > 040000 and stime[1] < 040000) Then
Exitlong();
즐거운 하루되세요
> 난정욱 님이 쓴 글입니다.
> 제목 : 야간매매
> 안녕하세요 야간선물 당일 6시부터 익일 4시까지 매매할려고 합니다
주간에 사용하던건데 야간에 사용할려고 합니다
수식이 맞는지 한번만 확인 부탁 드립니다 감사합니다
input : LossPoint(0.65),진입양봉갯수(3),청산양봉갯수(3),청산음봉갯수(3),
재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if (stime >= 180000 or stime < 040000) and
MarketPosition == 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1)) and
&& MAv1 > MAv2
&& MAv2 > MAv3
&& MAv3 > MAv4
&& C > MAv4
Then
{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 Then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,진입양봉갯수) == 진입양봉갯수 ) and
rebuy < 재매수횟수 and C > MAv1 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,청산양봉갯수) == 청산양봉갯수 or Countif(cond2 == true,청산음봉갯수) == 청산음봉갯수 Then
ExitLong("매수청산4");
}
if stime == 040000 or (stime > 040000 and stime[1] < 040000) Then
Exitlong();
난정욱
2013-07-04 15:36:19
하나만 더 여쭤 보겠습니다
이식에서 매수 진입이나 재매수 진입이후
고점에서 밑으로 몇 포인트 빠지면 청산신호가 나오지 않아도 강제 청산을
하고 싶습니다 외부 변수로 부탁 드립니다
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 야간매매
> 안녕하세요
예스스탁입니다.
18시 부터 거래가 시작되므로
초기화 시점이 date != date[1]가 아닌 18시가 되어야 합니다.
date != date[1]는 0시가 기준이 됩니다.
당일 진입횟수를 세는 부분도 변경해야 합니다.
아래 수정한식 참고하시기 바랍니다.
input : LossPoint(0.65),진입양봉갯수(3),청산양봉갯수(3),청산음봉갯수(3),
재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
#초기화
if stime == 180000 or (stime > 180000 and stime[1] < 180000) Then{
Rebuy = 0;
ReEL = 0;
count = 0;
}
#진입횟수 카운트
if (stime >= 180000 or stime < 040000) and
MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
count = count+1;
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if (stime >= 180000 or stime < 040000) and
MarketPosition == 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1))
&& MAv1 > MAv2
&& MAv2 > MAv3
&& MAv3 > MAv4
&& C > MAv4
Then
{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 and (stime >= 180000 or stime < 040000) then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,진입양봉갯수) == 진입양봉갯수 ) and
rebuy < 재매수횟수 and C > MAv1 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,청산양봉갯수) == 청산양봉갯수 or Countif(cond2 == true,청산음봉갯수) == 청산음봉갯수 Then
ExitLong("매수청산4");
}
if stime == 040000 or (stime > 040000 and stime[1] < 040000) Then
Exitlong();
즐거운 하루되세요
> 난정욱 님이 쓴 글입니다.
> 제목 : 야간매매
> 안녕하세요 야간선물 당일 6시부터 익일 4시까지 매매할려고 합니다
주간에 사용하던건데 야간에 사용할려고 합니다
수식이 맞는지 한번만 확인 부탁 드립니다 감사합니다
input : LossPoint(0.65),진입양봉갯수(3),청산양봉갯수(3),청산음봉갯수(3),
재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if (stime >= 180000 or stime < 040000) and
MarketPosition == 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1)) and
&& MAv1 > MAv2
&& MAv2 > MAv3
&& MAv3 > MAv4
&& C > MAv4
Then
{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 Then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,진입양봉갯수) == 진입양봉갯수 ) and
rebuy < 재매수횟수 and C > MAv1 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,청산양봉갯수) == 청산양봉갯수 or Countif(cond2 == true,청산음봉갯수) == 청산음봉갯수 Then
ExitLong("매수청산4");
}
if stime == 040000 or (stime > 040000 and stime[1] < 040000) Then
Exitlong();
예스스탁 예스스탁 답변
2013-07-05 14:39:34
안녕하세요
예스스탁입니다.
input : LossPoint(0.65),진입양봉갯수(3),청산양봉갯수(3),청산음봉갯수(3),
재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7),X(0.5);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
#초기화
if stime == 180000 or (stime > 180000 and stime[1] < 180000) Then{
Rebuy = 0;
ReEL = 0;
count = 0;
}
#진입횟수 카운트
if (stime >= 180000 or stime < 040000) and
MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
count = count+1;
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if (stime >= 180000 or stime < 040000) and
MarketPosition == 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1))
&& MAv1 > MAv2
&& MAv2 > MAv3
&& MAv3 > MAv4
&& C > MAv4
Then
{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 and (stime >= 180000 or stime < 040000) then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,진입양봉갯수) == 진입양봉갯수 ) and
rebuy < 재매수횟수 and C > MAv1 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,청산양봉갯수) == 청산양봉갯수 or Countif(cond2 == true,청산음봉갯수) == 청산음봉갯수 Then
ExitLong("매수청산4");
}
if stime == 040000 or (stime > 040000 and stime[1] < 040000) Then
Exitlong();
#진입이후 최고가에서 0.5포인트 하락하면 청산
if MarketPosition == 1 Then
ExitLong("bx",AtStop,highest(H,BarsSinceEntry)-x);
즐거운 하루되세요
> 난정욱 님이 쓴 글입니다.
> 제목 : Re : Re : 야간매매
> 하나만 더 여쭤 보겠습니다
이식에서 매수 진입이나 재매수 진입이후
고점에서 밑으로 몇 포인트 빠지면 청산신호가 나오지 않아도 강제 청산을
하고 싶습니다 외부 변수로 부탁 드립니다
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 야간매매
> 안녕하세요
예스스탁입니다.
18시 부터 거래가 시작되므로
초기화 시점이 date != date[1]가 아닌 18시가 되어야 합니다.
date != date[1]는 0시가 기준이 됩니다.
당일 진입횟수를 세는 부분도 변경해야 합니다.
아래 수정한식 참고하시기 바랍니다.
input : LossPoint(0.65),진입양봉갯수(3),청산양봉갯수(3),청산음봉갯수(3),
재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
#초기화
if stime == 180000 or (stime > 180000 and stime[1] < 180000) Then{
Rebuy = 0;
ReEL = 0;
count = 0;
}
#진입횟수 카운트
if (stime >= 180000 or stime < 040000) and
MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
count = count+1;
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if (stime >= 180000 or stime < 040000) and
MarketPosition == 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1))
&& MAv1 > MAv2
&& MAv2 > MAv3
&& MAv3 > MAv4
&& C > MAv4
Then
{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 and (stime >= 180000 or stime < 040000) then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,진입양봉갯수) == 진입양봉갯수 ) and
rebuy < 재매수횟수 and C > MAv1 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,청산양봉갯수) == 청산양봉갯수 or Countif(cond2 == true,청산음봉갯수) == 청산음봉갯수 Then
ExitLong("매수청산4");
}
if stime == 040000 or (stime > 040000 and stime[1] < 040000) Then
Exitlong();
즐거운 하루되세요
> 난정욱 님이 쓴 글입니다.
> 제목 : 야간매매
> 안녕하세요 야간선물 당일 6시부터 익일 4시까지 매매할려고 합니다
주간에 사용하던건데 야간에 사용할려고 합니다
수식이 맞는지 한번만 확인 부탁 드립니다 감사합니다
input : LossPoint(0.65),진입양봉갯수(3),청산양봉갯수(3),청산음봉갯수(3),
재매수횟수(3),재매수청산횟수(3),ProfitPoint(3.7);
var : cnt(0),count(0),rebuy(0),ReEL(0);
var : cond1(false),cond2(false);
//ma1
input : maPeriod1(8);
var : MAv1(0);
MAv1 = ma(C,maPeriod1);
//ma2
input : maPeriod2(16);
var : MAv2(0);
MAv2 = ma(C,maPeriod2);
//ma3
input : maPeriod3(23);
var : MAv3(0);
MAv3 = ma(C,maPeriod3);
//ma4
input : maPeriod4(47);
var : MAv4(0);
MAv4 = ma(C,maPeriod4);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("최초매수") == true Then{
Rebuy = 0;
ReEL = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] and IsEntryName("재매수") == true Then
Rebuy = Rebuy+1;
if BarsSinceExit(1) == 1 and MarketPosition != MarketPosition[1] and IsExitName("매수청산4",1) == true Then
ReEL = ReEL+1;
cond1 = C > O or (C==O and C >= C[1]);
cond2 = C < O or (C==O and C < C[1]);
if (stime >= 180000 or stime < 040000) and
MarketPosition == 0 and
(count == 0 or
(count > 0 and IsExitName("매수청산4",1) == false) or
(count > 0 and countif(C < mav4,BarsSinceExit(1)) >= 1)) and
&& MAv1 > MAv2
&& MAv2 > MAv3
&& MAv3 > MAv4
&& C > MAv4
Then
{
Buy("최초매수", OnClose, DEF);
}
if MarketPosition == 1 Then{
ExitLong("매수청산2",AtStop,EntryPrice-Losspoint);
ExitLong("매수청산3",AtLimit,EntryPrice+Profitpoint);
}
if MarketPosition == 1 and C < MAv4 Then
Exitlong("매수청산1");
if count >= 1 Then{
if MarketPosition == 0 and
(IsEntryName("최초매수",1) == true or IsEntryName("재매수",1) == true) and
IsExitName("매수청산4",1) == True and
BarsSinceExit(1) >= 3 and
(Countif(cond1 == true,진입양봉갯수) == 진입양봉갯수 ) and
rebuy < 재매수횟수 and C > MAv1 and
countif(C < mav4,BarsSinceExit(1)) < 1 Then
buy("재매수");
}
if MarketPosition == 1 and BarsSinceEntry >= 3 and ReEL < 재매수청산횟수 then{
if Countif(cond1 == true,청산양봉갯수) == 청산양봉갯수 or Countif(cond2 == true,청산음봉갯수) == 청산음봉갯수 Then
ExitLong("매수청산4");
}
if stime == 040000 or (stime > 040000 and stime[1] < 040000) Then
Exitlong();
이전글