커뮤니티
리버스데이시스템에서 손실시 추가진입 중지 수식 요청입니다
2014-07-31 09:52:10
145
글번호 77284
리버스데이시스템에서 손실시 추가진입 중지 수식 요청입니다
첫 진입 이후 손실시 추가 신호를 다 안들어가고 싶어서요
첫진입-피라미딩-리버스신호(전체청산)-이후 발생신호 전체 무시(앞에 리버스신호 포함)
부탁드립니다
////////////////////////////////////////////////////////////////////
안녕하세요
예스스탁입니다.
input : loss(0.3);
Condition1 = ExitDate(1) == sdate and (IsExitName("bx",1) == true or IsExitName("sx",1) == true);
//Condition1이 false일때만 진입
if Condition1 == false then{
//매수포지션 첫진입
if MarketPosition <= 0 and crossup(c,ma(C,20)) Then
buy("선물매수1");
//매도포지션 첫진입
if MarketPosition >= 0 and crossdown(c,ma(C,20)) Then
sell("선물매도1");
}
#매수포지션 첫진입가 -0.3%면 일괄청산
if MarketPosition == 1 Then
ExitLong("bx",AtStop,EntryPrice*(1-Loss/100));
#매도포지션 첫진입가 +0.3%면 일괄청산
if MarketPosition == -1 Then
ExitShort("sx",AtStop,EntryPrice*(1+Loss/100));
즐거운 하루되세요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : isexitname 일괄청산후 거래중지 식요청입니다
> 안녕하세요
예스스타입니다.
식을 아래와 같이 구성하시면 됩니다.
#직전청산이 당일발생한 청산이고 손절이며 진입명은 "선물매수1"이면 Condition1은 True
#위 내용이 아니면 Condition1은 false;
Condition1 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and IsEntryName("선물매수1",1) == true ;
//Condition1이 false일때만 진입
if Condition1 == false then{
if 매수조건1 Then
buy("선물매수1");
if 매수조건2 Then
buy("선물매수2");
if 매도조건1 Then
sell("선물매도1");
if 매도조건2 Then
sell("선물매도2");
}
SetStopLoss(0.3,PercentStop);
즐거운 하루되세요
> 데니얼 님이 쓴 글입니다.
> 제목 : isexitname 일괄청산후 거래중지 식요청입니다
> "선물매수1"(진입명) 로 진입한 당일 포지션이 손절 0.3% 청산되면 추후 진입한 모든 포지션을 청산 후 당일 거래 중지
수식 요청드립니다
답변 1
예스스탁 예스스탁 답변
2014-07-31 11:09:32
안녕하세요
예스스타입니다.
input : loss(0.3);
var : DayEntryCount(0);
if stime == 090000 or (stime > 090000 and stime[1] < 090000) Then
DayEntryCount = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
DayEntryCount = DayEntryCount+1;
if crossup(c,ma(C,20)) Then{
if DayEntryCount == 0 //당일 첫진입
Or (DayEntryCount >= 1 and MarketPosition == 0 and PositionProfit(1) > 0) //두번째 이후 무포지션일때(직전거래 수익)
Or (DayEntryCount >= 1 and MarketPosition == -1 and PositionProfit > 0) Then // 두번째 이후 매도포지션일때(수익)
buy("선물매수1");
if (DayEntryCount >= 1 and MarketPosition == -1 and PositionProfit < 0) Then//두번째 이후 매도포지션일때(손실)
ExitShort("매도청산");
}
if crossdown(c,ma(C,20)) Then{
if DayEntryCount == 0 //당일 첫진입
Or (DayEntryCount >= 1 and MarketPosition == 0 and PositionProfit(1) > 0) //두번째 이후 무포지션일때(직전거래수익)
Or (DayEntryCount >= 1 and MarketPosition == 1 and PositionProfit > 0) Then // 두번째 이후 매수포지션일때(수익)
sell("선물매도1");
if (DayEntryCount >= 1 and MarketPosition == 1 and PositionProfit < 0) Then // 두번째 이후 매수포지션일때(손실)
Exitlong("매수청산");
}
#매수포지션 첫진입가 -0.3%면 일괄청산
if MarketPosition == 1 Then
ExitLong("매수손절",AtStop,EntryPrice*(1-Loss/100));
#매도포지션 첫진입가 +0.3%면 일괄청산
if MarketPosition == -1 Then
ExitShort("매도손절",AtStop,EntryPrice*(1+Loss/100));
즐거운 하루되세요
> 데니얼 님이 쓴 글입니다.
> 제목 : 리버스데이시스템에서 손실시 추가진입 중지 수식 요청입니다
> 리버스데이시스템에서 손실시 추가진입 중지 수식 요청입니다
첫 진입 이후 손실시 추가 신호를 다 안들어가고 싶어서요
첫진입-피라미딩-리버스신호(전체청산)-이후 발생신호 전체 무시(앞에 리버스신호 포함)
부탁드립니다
////////////////////////////////////////////////////////////////////
안녕하세요
예스스탁입니다.
input : loss(0.3);
Condition1 = ExitDate(1) == sdate and (IsExitName("bx",1) == true or IsExitName("sx",1) == true);
//Condition1이 false일때만 진입
if Condition1 == false then{
//매수포지션 첫진입
if MarketPosition <= 0 and crossup(c,ma(C,20)) Then
buy("선물매수1");
//매도포지션 첫진입
if MarketPosition >= 0 and crossdown(c,ma(C,20)) Then
sell("선물매도1");
}
#매수포지션 첫진입가 -0.3%면 일괄청산
if MarketPosition == 1 Then
ExitLong("bx",AtStop,EntryPrice*(1-Loss/100));
#매도포지션 첫진입가 +0.3%면 일괄청산
if MarketPosition == -1 Then
ExitShort("sx",AtStop,EntryPrice*(1+Loss/100));
즐거운 하루되세요
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : isexitname 일괄청산후 거래중지 식요청입니다
> 안녕하세요
예스스타입니다.
식을 아래와 같이 구성하시면 됩니다.
#직전청산이 당일발생한 청산이고 손절이며 진입명은 "선물매수1"이면 Condition1은 True
#위 내용이 아니면 Condition1은 false;
Condition1 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and IsEntryName("선물매수1",1) == true ;
//Condition1이 false일때만 진입
if Condition1 == false then{
if 매수조건1 Then
buy("선물매수1");
if 매수조건2 Then
buy("선물매수2");
if 매도조건1 Then
sell("선물매도1");
if 매도조건2 Then
sell("선물매도2");
}
SetStopLoss(0.3,PercentStop);
즐거운 하루되세요
> 데니얼 님이 쓴 글입니다.
> 제목 : isexitname 일괄청산후 거래중지 식요청입니다
> "선물매수1"(진입명) 로 진입한 당일 포지션이 손절 0.3% 청산되면 추후 진입한 모든 포지션을 청산 후 당일 거래 중지
수식 요청드립니다