커뮤니티
문의드립니다.
2013-08-27 23:46:47
128
글번호 66896
안녕하세요.
아래 수식에서 추가할 내용 부탁드립니다.
당일 첫 진입은 1계약입니다.
첫 진입 후, 손절이면 다음 진입은 2계약이며 연속 손실일때마다 1계약씩 추가합니다.
직전진입이 수익이었으면 1계약으로 돌아옵니다.
최대 계약은 n계약이며, n계약짜리가 손절되면 당일 매매 완료
-----------------------------------------------------------------
Input : Period(9);
Var : value(0);
value = CCI(Period);
if stime >= 90100 and stime < 144000 Then{
# 매수/매도청산
If CrossUp(value,-100) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value,100) Then
{
Sell();
}
}
SetStopProfittarget(1,PointStop);
SetStopLoss(1,PointStop);
SetStopEndofday(144900);
답변 1
예스스탁 예스스탁 답변
2013-08-28 10:08:52
안녕하세요
예스스탁입니다.
Input : Period(9),n(5);
Var : value(0),cnt(0),count(0);
value = CCI(Period);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
Condition1 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and CurrentContracts[BarsSinceExit(1)+1] == N;
if stime >= 90100 and stime < 144000 and Condition1 == false Then{
If CrossUp(value,-100) Then{
if count == 0 then
Buy("b1",OnClose,def,1);
if count > 0 and MarketPosition == 0 then
Buy("b2",OnClose,def,min(iff(PositionProfit(1) > 0,1,CurrentContracts[BarsSinceExit(1)+1]+1),n));
if count > 0 and MarketPosition == -1 then
Buy("b3",OnClose,def,min(iff(PositionProfit > 0,1,CurrentContracts+1),n));
}
If CrossDown(value,100) Then {
if count == 0 then
sell("s1",OnClose,def,1);
if count > 0 and MarketPosition == 0 then
Sell("s2",OnClose,def,min(iff(PositionProfit(1) > 0,1,CurrentContracts[BarsSinceExit(1)+1]+1),n));
if count > 0 and MarketPosition == 1 then
Sell("s3",OnClose,def,min(iff(PositionProfit > 0,1,CurrentContracts+1),n));
}
}
SetStopProfittarget(1,PointStop);
SetStopLoss(1,PointStop);
SetStopEndofday(144900);
즐거운 하루되세요
> 쿠루드 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요.
아래 수식에서 추가할 내용 부탁드립니다.
당일 첫 진입은 1계약입니다.
첫 진입 후, 손절이면 다음 진입은 2계약이며 연속 손실일때마다 1계약씩 추가합니다.
직전진입이 수익이었으면 1계약으로 돌아옵니다.
최대 계약은 n계약이며, n계약짜리가 손절되면 당일 매매 완료
-----------------------------------------------------------------
Input : Period(9);
Var : value(0);
value = CCI(Period);
if stime >= 90100 and stime < 144000 Then{
# 매수/매도청산
If CrossUp(value,-100) Then
{
Buy();
}
# 매도/매수청산
If CrossDown(value,100) Then
{
Sell();
}
}
SetStopProfittarget(1,PointStop);
SetStopLoss(1,PointStop);
SetStopEndofday(144900);