커뮤니티
재질문입니다.
2010-02-09 01:37:45
666
글번호 27958
아래식으로 하니 순서대로 잘돌아갑니다.
그런데 한가지 더 하고 싶습니다.
목표수익청산이 되면 1차매수조건부터 다시 시작하더라고요
1차매수조건이 목표수익청산이 되면 다시 1차매수조건이 아닌 2차매수로...순차적으로 하는 식이 궁금합니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 시스템 매수
> 안녕하세요
예스스탁입니다.
if MarketPosition == 0 and 1차매수조건 Then
buy();
if MarketPosition == 1 Then{
if CurrentEntries == 1 and 2차매수조건 Then
buy();
if CurrentEntries == 2 and 3차매수조건 Then
buy();
if CurrentEntries == 3 and 4차매수조건 Then
buy();
}
답변 1
예스스탁 예스스탁 답변
2010-02-09 15:05:17
안녕하세요
예스스탁입니다.
해당내용은 피라미딩시 추가진입분에 대한 판단이 이루어 져야 하는데
추가진입분에대해 횟수나 수량으로 뿐이 횟수가 판단이 되지 않아
컨트롤이 어려울 것 같습니다.
아래식을 참고하시기 바랍니다.
첫진입으로 초기화되는 부분이 필요하여
분봉에서 당일청산을 염도에 두고 작성한 식입니다.
var : cnt(0),count(0);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if count == 0 or (count > 0 and IsExitName("stopProfittarget",1) == False) Then{
if MarketPosition == 0 and 1차매수조건 Then
buy("b");
}
if count > 0 and IsExitName("stopProfittarget",1) == true and MarketPosition == 0 Then{
if 1차매수조건 and MaxEntries(1) == 0 Then
buy("b1");
if 2차매수조건 and MaxEntries(1) == 1 Then
buy("b2");
if 3차매수조건 and MaxEntries(1) == 2 Then
buy("b3");
if 4차매수조건 and MaxEntries(1) == 3 Then
buy("b4");
}
if MarketPosition == 1 Then{
if IsEntryName("b1") == true or IsEntryName("b") == True Then{
if CurrentEntries == 1 and 2차매수조건 Then
buy();
if CurrentEntries == 2 and 3차매수조건 Then
buy();
if CurrentEntries == 3 and 4차매수조건 Then
buy();
}
if IsEntryName("b2") == true Then{
if CurrentEntries == 2 and 3차매수조건 Then
buy();
if CurrentEntries == 3 and 4차매수조건 Then
buy();
}
if IsEntryName("b3") == true Then{
if CurrentEntries == 2 and 4차매수조건 Then
buy();
}
}
즐거운 하루되세요
> neokim 님이 쓴 글입니다.
> 제목 : 재질문입니다.
> 아래식으로 하니 순서대로 잘돌아갑니다.
그런데 한가지 더 하고 싶습니다.
목표수익청산이 되면 1차매수조건부터 다시 시작하더라고요
1차매수조건이 목표수익청산이 되면 다시 1차매수조건이 아닌 2차매수로...순차적으로 하는 식이 궁금합니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 시스템 매수
> 안녕하세요
예스스탁입니다.
if MarketPosition == 0 and 1차매수조건 Then
buy();
if MarketPosition == 1 Then{
if CurrentEntries == 1 and 2차매수조건 Then
buy();
if CurrentEntries == 2 and 3차매수조건 Then
buy();
if CurrentEntries == 3 and 4차매수조건 Then
buy();
}
다음글
이전글