커뮤니티
재문의드립니다.
2012-05-29 17:10:21
273
글번호 51449
안녕하세요.
아래에 문의드린 수식에 대한 답변을 받았는데, 여기서 수정하고 싶어서 다시 문의드립니다.
기존의 청산이
#청산
'5분봉 크기 만큼의 이익이 나면 청산' 이었는데요,
이 부분을 5분봉 크기의 세 배만큼의 이익이 나면 청산하는 식으로 수정 부탁드립니다.ㅠ
var : cnt(0),count(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
var1 = H;
var2 = L;
}
if count < 1 and dayindex > 0 Then{
if c > var1 and C > O Then
buy();
if c < var2 and C < O Then
sell();
}
if MarketPosition == 1 Then{
ExitLong("bx1",AtStop,EntryPrice+(var1-var2));
ExitLong("bx2",AtStop,EntryPrice-(var1-var2));
}
if MarketPosition == -1 Then{
ExitShort("sx1",AtStop,EntryPrice+(var1-var2));
ExitShort("sx2",AtStop,EntryPrice-(var1-var2));
}
답변 1
예스스탁 예스스탁 답변
2012-05-29 22:08:30
안녕하세요
예스스탁입니다.
input : N(3);
var : cnt(0),count(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
var1 = H;
var2 = L;
}
if count < 1 and dayindex > 0 Then{
if c > var1 and C > O Then
buy();
if c < var2 and C < O Then
sell();
}
if MarketPosition == 1 Then{
ExitLong("매수수익",AtLimit,EntryPrice+(var1-var2)*N);
ExitLong("매수손절",AtStop,EntryPrice-(var1-var2));
}
if MarketPosition == -1 Then{
ExitShort("매도수익",AtLimit,EntryPrice-(var1-var2)*N);
ExitShort("매도손절",AtStop,EntryPrice+(var1-var2));
}
기존에 식이 잘못된 부분이 있었습니다.
해당 부분 수정하고 문의하신 내용 추가했습니다.
N값으로 수익 배수 조정하시면 됩니다.
즐거운 하루되세요
> 레드코어 님이 쓴 글입니다.
> 제목 : 재문의드립니다.
> 안녕하세요.
아래에 문의드린 수식에 대한 답변을 받았는데, 여기서 수정하고 싶어서 다시 문의드립니다.
기존의 청산이
#청산
'5분봉 크기 만큼의 이익이 나면 청산' 이었는데요,
이 부분을 5분봉 크기의 세 배만큼의 이익이 나면 청산하는 식으로 수정 부탁드립니다.ㅠ
var : cnt(0),count(0);
count = 0;
for cnt = 0 to 10{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if date != date[1] Then{
var1 = H;
var2 = L;
}
if count < 1 and dayindex > 0 Then{
if c > var1 and C > O Then
buy();
if c < var2 and C < O Then
sell();
}
if MarketPosition == 1 Then{
ExitLong("bx1",AtStop,EntryPrice+(var1-var2));
ExitLong("bx2",AtStop,EntryPrice-(var1-var2));
}
if MarketPosition == -1 Then{
ExitShort("sx1",AtStop,EntryPrice+(var1-var2));
ExitShort("sx2",AtStop,EntryPrice-(var1-var2));
}
다음글
이전글