커뮤니티
질문 있습니다..
2008-06-01 01:44:31
1061
글번호 15601
var : count(0),EntryCount(0),LossCutCount(0);
input : count손실기준(0.9),손절횟수(2),진입횟수(5) ,일최대누적손실point(2) ,최대연속손실거래횟수(3) ;
#-------------------------------------------------------------
If stime>=090000 and stime<=143000 Then {
EntryCount = 0 ;
LossCutCount = 0;
For Count = 0 to 10
{
If EntryDate(Count) == sdate then
EntryCount = EntryCount+1;
If EntryDate(Count+1) == sdate and PositionProfit(Count+1) < -(count손실기준) Then
LossCutCount =LossCutCount+1;
}
}
condition49 = LossCutCount<손절횟수 and EntryCount<진입횟수 and GrossLoss<일최대누적손실point and MaxConsecLosers<최대연속손실거래횟수 ;
if stiem>090000 and stiem<=143000 then
if condition49==true then {
if 진입조건 a then buy("BUY",atmarket) ;
if 진입조건 b then sell("SELL",atmarket) ;
}
## 몇 가지 손절 조건식 있음..
## 몇가지 청산 조건식 있음..
If sTime==144500 Then {
If marketposition()!=0 Then
exitlong("FEL",atmarket);
exitshort("FES",atmarket);
}
=====
질문]
선물 단기 분봉,당일 청산하는 식에서..
위 구문에서 "손절횟수", "진입횟수"는 먹는데..
"일최대누적손실point" 및 "최대연속손실거래횟수"는 안 먹거든요?
그 이유가 뭔가요..명령이나 구문이 어디가 잘못되었는지요..?
수고하십시요...
답변 1
예스스탁 예스스탁 답변
2008-06-02 09:34:01
안녕하세요
예스스탁입니다.
GrossLoss와 MaxConsecLosers는 당일만 카운팅하여 계산하는 함수가 아닙니다.
전체 거래에서 따지는 함수이므로 사용자분 의도와 맞지 않았습니다.
식을 수정했습니다.
input : count손실기준(0.9),손절횟수(2),진입횟수(5) ,일최대누적손실point(2) ,최대연속손실거래횟수(3) ;
var : count(0),EntryCount(0),LossCutCount(0),DGrossLoss(0),DConsecLosers(0),DMaxConsecLosers(0),진입조건a(0),진입조건b(0);
#-------------------------------------------------------------
EntryCount = 0;
LossCutcount = 0;
DGrossLoss = 0;
DConsecLosers = 0;
DMaxConsecLosers = 0;
For Count = 0 to 10 {
If EntryDate(Count) == sdate then
EntryCount = EntryCount+1;
If EntryDate(Count+1) == sdate and PositionProfit(Count+1) < -(count손실기준) Then
LossCutCount =LossCutCount+1;
}
if EntryDate(count) == sdate and PositionProfit(count) < 0 Then{
DGrossloss = DGrossloss +1; //당일 손실거래만 누적
if EntryDate(count) == sdate Then{
if PositionProfit(count) < 0 Then
DConsecLosers = DConsecLosers +1; //당일 손실거래만 누적
Else
DConsecLosers = 0; //당일 손실거래만 누적
}
IF DConsecLosers > DMaxConsecLosers Then
DMaxConsecLosers = DConsecLosers;
}
condition49 = LossCutCount<손절횟수 and EntryCount<진입횟수 and
DGrossLoss<일최대누적손실point and DMaxConsecLosers<최대연속손실거래횟수 ;
if sTime>090000 and sTime<=143000 then
if condition49==true then {
if 진입조건a then
buy("BUY",atmarket) ;
if 진입조건b then
sell("SELL",atmarket) ;
}
## 몇 가지 손절 조건식 있음..
## 몇가지 청산 조건식 있음..
If sTime==144500 Then {
If marketposition()!=0 Then
exitlong("FEL",atmarket);
exitshort("FES",atmarket);
}
참고하시기 바랍니다.
즐거운 하루되세요
> CJ_coco 님이 쓴 글입니다.
> 제목 : 질문 있습니다..
> var : count(0),EntryCount(0),LossCutCount(0);
input : count손실기준(0.9),손절횟수(2),진입횟수(5) ,일최대누적손실point(2) ,최대연속손실거래횟수(3) ;
#-------------------------------------------------------------
If stime>=090000 and stime<=143000 Then {
EntryCount = 0 ;
LossCutCount = 0;
For Count = 0 to 10
{
If EntryDate(Count) == sdate then
EntryCount = EntryCount+1;
If EntryDate(Count+1) == sdate and PositionProfit(Count+1) < -(count손실기준) Then
LossCutCount =LossCutCount+1;
}
}
condition49 = LossCutCount<손절횟수 and EntryCount<진입횟수 and GrossLoss<일최대누적손실point and MaxConsecLosers<최대연속손실거래횟수 ;
if stiem>090000 and stiem<=143000 then
if condition49==true then {
if 진입조건 a then buy("BUY",atmarket) ;
if 진입조건 b then sell("SELL",atmarket) ;
}
## 몇 가지 손절 조건식 있음..
## 몇가지 청산 조건식 있음..
If sTime==144500 Then {
If marketposition()!=0 Then
exitlong("FEL",atmarket);
exitshort("FES",atmarket);
}
=====
질문]
선물 단기 분봉,당일 청산하는 식에서..
위 구문에서 "손절횟수", "진입횟수"는 먹는데..
"일최대누적손실point" 및 "최대연속손실거래횟수"는 안 먹거든요?
그 이유가 뭔가요..명령이나 구문이 어디가 잘못되었는지요..?
수고하십시요...