커뮤니티
수정바랍니다.
2011-12-16 01:29:36
488
글번호 45820
지정한 날부터 신호발생시 매수되게
사용사가 변수입력 가능하다면 수정바랍니다.. 그리고
1차매수뿐아니라 2차매수와 3차매수도 첫번째로 매수 진입이 가능하고
처음 매수된 매수조건의 금액보다 하락하는경우만 매수되게 해주세요.
예]
일단,매수(매수1.2.3차)와 중간청산(청산1차,청산2차)은 해당조건에서
각각 한번씩만 이루어져야 합니다
첫매수가 1차매수지점에서 되는경우
그 보다 하락한 2차와 3차매수조건에서 매수가 됩니다.
청산 1.2차는 동일 합니다.
첫매수가 2차매수에서 되는경우
그보다 하락한 3차매수에서만 매수가 되야하고
중간청산은 청산2차에서 되야 합니다.
첫매수가 3차에서되는경우
더이상의 매수와 중간청산은 없어야 합니다.
input : 최고점(20000),최저점(10000);
var : 중간값(0),매수1차(0),매수2차(0),매수3차(0),청산1차(0),청산2차(0);
중간값 = (최고점+최저점)/2;
매수1차 = (최고점+중간값)/2;
매수2차 = 중간값;
매수3차 = (중간값+최저점)/2;
청산1차 = (매수1차+중간값)/2;
청산2차 = (중간값+매수3차)/2;
if MarketPosition == 0 Then
buy("b1",AtStop,매수1차);
if MarketPosition == 1 Then{
if CurrentEntries == 1 Then
buy("b2",AtStop,매수2차);
if CurrentEntries == 1 Then
buy("b3",AtStop,매수3차);
}
if MarketPosition == 1 Then{
if CurrentEntries == MaxEntries and MaxEntries == 2 Then
exitlong("bx1",atlimit,청산1차,"B1");
if CurrentEntries == MaxEntries and MaxEntries == 3 Then
exitlong("bx2",atlimit,청산2차,"B1");
if CurrentEntries == MaxEntries and MaxEntries == 3 Then
exitlong("bx3",atlimit,청산2차,"B2");
}
if MarketPosition == 1 Then{
exitlong("bx4",atlimit,AvgEntryPrice*1.03,"",int(CurrentContracts*0.5),1);
exitlong("bx5",atlimit,AvgEntryPrice*1.05);
if crossup(C, AvgEntryPrice) Then{
Condition1 = true;
var1 = index;
}
if Condition1 == true Then{
exitlong("bx6",AtStop,highest(H,index-var1+1)*0.99,"",int(CurrentContracts*0.5),1);
exitlong("bx7",AtStop,highest(H,index-var1+1)*0.97);
}
exitlong("bx8",AtStop,최저점);
exitlong("bx9",AtStop,AvgEntryPrice*0.95);
}
답변 1
예스스탁 예스스탁 답변
2011-12-16 10:58:20
안녕하세요
예스스탁입니다.
피라미딩 설정을 다른진입신호만 허용으로 하시면 됩니다.
수정한 식입니다.
input : 최고점(20000),최저점(10000),시작날짜(20111216);
var : 중간값(0),매수1차(0),매수2차(0),매수3차(0),청산1차(0),청산2차(0);
중간값 = (최고점+최저점)/2;
매수1차 = (최고점+중간값)/2;
매수2차 = 중간값;
매수3차 = (중간값+최저점)/2;
청산1차 = (매수1차+중간값)/2;
청산2차 = (중간값+매수3차)/2;
if sdate >= 시작날짜 Then{
if MarketPosition == 0 or (MarketPosition == 1 and C < EntryPrice) Then{
buy("b1",AtStop,매수1차);
buy("b2",AtStop,매수2차);
buy("b3",AtStop,매수3차);
}
if MarketPosition == 1 Then{
if CurrentEntries == MaxEntries and MaxEntries == 2 Then
exitlong("bx1",atlimit,청산1차,"B1");
if CurrentEntries == MaxEntries and MaxEntries == 3 Then
exitlong("bx2",atlimit,청산2차,"B1");
if CurrentEntries == MaxEntries and MaxEntries == 3 Then
exitlong("bx3",atlimit,청산2차,"B2");
}
if MarketPosition == 1 Then{
exitlong("bx4",atlimit,AvgEntryPrice*1.03,"",int(CurrentContracts*0.5),1);
exitlong("bx5",atlimit,AvgEntryPrice*1.05);
if crossup(C, AvgEntryPrice) Then{
Condition1 = true;
var1 = index;
}
if Condition1 == true Then{
exitlong("bx6",AtStop,highest(H,index-var1+1)*0.99,"",int(CurrentContracts*0.5),1);
exitlong("bx7",AtStop,highest(H,index-var1+1)*0.97);
}
exitlong("bx8",AtStop,최저점);
exitlong("bx9",AtStop,AvgEntryPrice*0.95);
}
}
즐거운 하루되세요
> 쭈니오빠 님이 쓴 글입니다.
> 제목 : 수정바랍니다.
> 지정한 날부터 신호발생시 매수되게
사용사가 변수입력 가능하다면 수정바랍니다.. 그리고
1차매수뿐아니라 2차매수와 3차매수도 첫번째로 매수 진입이 가능하고
처음 매수된 매수조건의 금액보다 하락하는경우만 매수되게 해주세요.
예]
일단,매수(매수1.2.3차)와 중간청산(청산1차,청산2차)은 해당조건에서
각각 한번씩만 이루어져야 합니다
첫매수가 1차매수지점에서 되는경우
그 보다 하락한 2차와 3차매수조건에서 매수가 됩니다.
청산 1.2차는 동일 합니다.
첫매수가 2차매수에서 되는경우
그보다 하락한 3차매수에서만 매수가 되야하고
중간청산은 청산2차에서 되야 합니다.
첫매수가 3차에서되는경우
더이상의 매수와 중간청산은 없어야 합니다.
input : 최고점(20000),최저점(10000);
var : 중간값(0),매수1차(0),매수2차(0),매수3차(0),청산1차(0),청산2차(0);
중간값 = (최고점+최저점)/2;
매수1차 = (최고점+중간값)/2;
매수2차 = 중간값;
매수3차 = (중간값+최저점)/2;
청산1차 = (매수1차+중간값)/2;
청산2차 = (중간값+매수3차)/2;
if MarketPosition == 0 Then
buy("b1",AtStop,매수1차);
if MarketPosition == 1 Then{
if CurrentEntries == 1 Then
buy("b2",AtStop,매수2차);
if CurrentEntries == 1 Then
buy("b3",AtStop,매수3차);
}
if MarketPosition == 1 Then{
if CurrentEntries == MaxEntries and MaxEntries == 2 Then
exitlong("bx1",atlimit,청산1차,"B1");
if CurrentEntries == MaxEntries and MaxEntries == 3 Then
exitlong("bx2",atlimit,청산2차,"B1");
if CurrentEntries == MaxEntries and MaxEntries == 3 Then
exitlong("bx3",atlimit,청산2차,"B2");
}
if MarketPosition == 1 Then{
exitlong("bx4",atlimit,AvgEntryPrice*1.03,"",int(CurrentContracts*0.5),1);
exitlong("bx5",atlimit,AvgEntryPrice*1.05);
if crossup(C, AvgEntryPrice) Then{
Condition1 = true;
var1 = index;
}
if Condition1 == true Then{
exitlong("bx6",AtStop,highest(H,index-var1+1)*0.99,"",int(CurrentContracts*0.5),1);
exitlong("bx7",AtStop,highest(H,index-var1+1)*0.97);
}
exitlong("bx8",AtStop,최저점);
exitlong("bx9",AtStop,AvgEntryPrice*0.95);
}
다음글
이전글