커뮤니티
식수정
2017-05-11 13:29:55
148
글번호 109461
안녕하세요
53118에대한수정건 부탁드립니다
적용하였으나 전혀 하고자하는 방법이 아닌거 같습니다
이해가 부족한 부분이 있는거 같아요
간단설명
마디가에서 임의 진입후 10틱 단위에서 1차매수후 상승시 2차 3차 4차 이런식으로
+10틱상승시 마다 각1개씩추가 진입조건 입니다
단1차매수후 상승하지않고 하락시 -10틱에손절 재상승시 +10틱에재진입후상승시+10틱마다진입
4차까지 진입
익절=전체+50틱시 일괄청산
sw2조건삭제
매수식
예)시가에서 양봉이면 마디가 0.10 .20 .30.40.50.0 단위에서 임의진입
예=시가양봉 (30분봉)이면
매수 현재가에서 마디가에진입 -현재가가50,15이면
50.20에 매수진입=1차1계약진입
매수후 50.30에= 2차 추가1계 진입 50.40에 =3차 추가1계진입 50.50에 =4차 추가1계
4차까지만 진입
1차진입후 상승하지 못하고 하락시-10틱에서 손절=50.10가격
재매수조건=손절후 재상승하여 50.10가격에 오면 1차재매수후상승시 2.3.4차까지매수
1.2.3.4.차각마디가에서 진입후 하락시-10틱에서 각1개씩손절
익절 전체+50틱 도달시 일괄청산Inputs : Period(20), Sence(1.5), CC_DN(Yellow);
Vars:
VLineUp(0),
VLineDn(0),
HHighest(0),
LLowest(0),
JustChanged(FALSE),
VLine(0), DBN(0),T(0),HH(0),LL(0),H1(0),L1(0),Li(0),Hi(0),ee(0);
Array:
Highs[35](0),
Lows[35](0),
RRange[35](0),
UpWave[1](FALSE),
DnWave[1](FALSE);
If STime == 180000 Then
DBN = 0;
DBN = DBN + 1;
Var1 = Period;
Var2 = Var1 - 1;
Var3 = Var1 - 2;
Var5 = Sence;
Var6 = H-L;
JustChanged = FALSE;
if CurrentBar <= Var2 then begin
Highs[CurrentBar] = Close;
Lows[CurrentBar] = Close;
RRange[CurrentBar] = (H-L) /2;
end;
if CurrentBar == Var1 then begin
if Highs[Var2] >= Highs[Var3] then begin
UpWave[1] = TRUE;
HHighest = Highs[Var2];
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
#Plot1(VLineUp,"VLineUp");
end;
if Highs[Var2] < Highs[Var3] then begin
DnWave[1] = TRUE;
LLowest = Lows[Var2];
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
#Plot2(VLineDn,"VLineDn");
end;
end;
if CurrentBar > Var1 then begin
if DnWave[1] and Close > VLineDn then begin
DnWave[1] = FALSE;
UpWave[1] = TRUE;
JustChanged = TRUE;
HHighest = Close;
LLowest = 0;
end;
if UpWave[1] and Close < VLineUp and JustChanged == FALSE then begin
UpWave[1] = FALSE;
DnWave[1] = TRUE;
JustChanged = TRUE;
LLowest = Close;
HHighest = 0;
end;
if JustChanged == FALSE then begin
if Close > HHighest then
HHighest = Close;
else if Close < LLowest then
LLowest = Close;
end;
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
if UpWave[1] then T = 1;
else if DnWave[1] then T = -1;
end;
if T == 1 and T[1] != 1 Then{
H1 = H;
HH = H;
Hi = 0;
if MarketPosition <= 0 and LI >= 10 and LL <= L1-PriceScale*30 then
buy("b",OnClose,def,1);
}
if T == -1 and T[1] != -1 Then{
L1 = L;
LL = L;
Li = 0;
if MarketPosition >= 0 and HI >= 10 and HH >= H1+PriceScale*30 then
sell("s",OnClose,def,1);
}
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
ee = LatestEntryPrice(0);
if CurrentContracts < CurrentContracts[1] Then
ee = LatestExitPrice(0);
if MaxEntries < 5 then
buy("bb",AtStop,LatestEntryPrice(0)+PriceScale*10,1);
ExitLong("bl",AtStop,ee-PriceScale*10,"",1,2);
ExitLong("bp",AtLimit,ee+PriceScale*50);
}
if MarketPosition == -1 Then{
if CurrentContracts > CurrentContracts[1] Then
ee = LatestEntryPrice(0);
if CurrentContracts < CurrentContracts[1] Then
ee = LatestExitPrice(0);
if MaxEntries < 5 then
sell("ss",AtStop,LatestEntryPrice(0)-PriceScale*10,1);
ExitShort("sx",AtStop,ee+PriceScale*10,"",1,2);
ExitShort("sp",AtLimit,ee-PriceScale*50);
}
if T == 1 Then{
Hi = Hi+1;
if H > HH Then
HH = H;
}
if T == -1 Then{
Li = Li+1;
if L < LL Then
LL = L;
}
답변 1
예스스탁 예스스탁 답변
2017-05-11 17:34:12
안녕하세요
예스스탁입니다.
올려주신 내용은 아래 내용 정도뿐이 작성이 가능하지 않을것 같습니다.
0.1단위로 상승하락에 따라 추가진입이나 일부 청산을 해야 하는데
그러기 위해서는 포지션 진행중 최근 진입가나 청산가를 기존으로
0.1씩 상승하락을 체크할수 밖에 없습니다.
아래식은 첫봉이 양봉이면 양봉의 종가를 기준으로 수숫점 2자리가 0인 가까운 수를 찾고
해당 가격이상의 시세가 발생하면 첫진입을 하고
이후 0.1 등락에 따라 1계약 추가매수, 일부청산을 반복합니다.
식적용시 피라미딩을 모든진입신호 허용으로 설정하고 적용하셔야 합니다.
수식은 사용자분 본인이 작성하신다는 전제에 일부 도움을 드리지 위함입니다.
이후의 내용은 아래식과 주석을 참고하셔서 직접 수정보완하시기 바랍니다.
var : T(0),ee(0),pp(0);
#당일 첫봉
if Bdate != Bdate[1] then{
#마디가 소숫점2자리가 0으로 끝나는 숫자
pp = Ceiling(c/0.1)*0.1;
#양봉이면 1, 음봉이면 -1, 도지면 0
T = 0;
if C > O Then
T = 1;
if C < O Then
T = -1;
}
#첫봉이 양봉이면 PP가격 이상의 시세 발생하면 첫매수
if MarketPosition <= 0 and T == 1 Then
buy("b",AtStop,pp,1);
if MarketPosition == 1 Then{
#진입발생하면 최근 진입가 저장
if CurrentContracts > CurrentContracts[1] Then
ee = LatestEntryPrice(0);
#일부청산발생하면 최근 청산가
if CurrentContracts < CurrentContracts[1] Then
ee = LatestExitPrice(0);
#var1값 대비 0.5상승하면 일괄청산
exitlong("bx",atlimit,var1+0.5);
#최근 진입혹은 청산가에서 0.1 상승하면 추가1계약 매수진입(최대 진입횟수가 5회까지만 진입)
if MaxEntries < 5 Then
buy("bb",AtStop,ee+0.1,1);
#최근 진입 혹은 청산가에서 0.1하락하면 1계약 청산
exitlong("bl",AtStop,LatestExitPrice(0)-0.1,"",1,2);
}
즐거운 하루되세요
> 아트정 님이 쓴 글입니다.
> 제목 : 식수정
> 안녕하세요
53118에대한수정건 부탁드립니다
적용하였으나 전혀 하고자하는 방법이 아닌거 같습니다
이해가 부족한 부분이 있는거 같아요
간단설명
마디가에서 임의 진입후 10틱 단위에서 1차매수후 상승시 2차 3차 4차 이런식으로
+10틱상승시 마다 각1개씩추가 진입조건 입니다
단1차매수후 상승하지않고 하락시 -10틱에손절 재상승시 +10틱에재진입후상승시+10틱마다진입
4차까지 진입
익절=전체+50틱시 일괄청산
sw2조건삭제
매수식
예)시가에서 양봉이면 마디가 0.10 .20 .30.40.50.0 단위에서 임의진입
예=시가양봉 (30분봉)이면
매수 현재가에서 마디가에진입 -현재가가50,15이면
50.20에 매수진입=1차1계약진입
매수후 50.30에= 2차 추가1계 진입 50.40에 =3차 추가1계진입 50.50에 =4차 추가1계
4차까지만 진입
1차진입후 상승하지 못하고 하락시-10틱에서 손절=50.10가격
재매수조건=손절후 재상승하여 50.10가격에 오면 1차재매수후상승시 2.3.4차까지매수
1.2.3.4.차각마디가에서 진입후 하락시-10틱에서 각1개씩손절
익절 전체+50틱 도달시 일괄청산Inputs : Period(20), Sence(1.5), CC_DN(Yellow);
Vars:
VLineUp(0),
VLineDn(0),
HHighest(0),
LLowest(0),
JustChanged(FALSE),
VLine(0), DBN(0),T(0),HH(0),LL(0),H1(0),L1(0),Li(0),Hi(0),ee(0);
Array:
Highs[35](0),
Lows[35](0),
RRange[35](0),
UpWave[1](FALSE),
DnWave[1](FALSE);
If STime == 180000 Then
DBN = 0;
DBN = DBN + 1;
Var1 = Period;
Var2 = Var1 - 1;
Var3 = Var1 - 2;
Var5 = Sence;
Var6 = H-L;
JustChanged = FALSE;
if CurrentBar <= Var2 then begin
Highs[CurrentBar] = Close;
Lows[CurrentBar] = Close;
RRange[CurrentBar] = (H-L) /2;
end;
if CurrentBar == Var1 then begin
if Highs[Var2] >= Highs[Var3] then begin
UpWave[1] = TRUE;
HHighest = Highs[Var2];
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
#Plot1(VLineUp,"VLineUp");
end;
if Highs[Var2] < Highs[Var3] then begin
DnWave[1] = TRUE;
LLowest = Lows[Var2];
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
#Plot2(VLineDn,"VLineDn");
end;
end;
if CurrentBar > Var1 then begin
if DnWave[1] and Close > VLineDn then begin
DnWave[1] = FALSE;
UpWave[1] = TRUE;
JustChanged = TRUE;
HHighest = Close;
LLowest = 0;
end;
if UpWave[1] and Close < VLineUp and JustChanged == FALSE then begin
UpWave[1] = FALSE;
DnWave[1] = TRUE;
JustChanged = TRUE;
LLowest = Close;
HHighest = 0;
end;
if JustChanged == FALSE then begin
if Close > HHighest then
HHighest = Close;
else if Close < LLowest then
LLowest = Close;
end;
VLineUp = HHighest - (Var5 * MA(Var6,Var2));
VLineDn = LLowest + (Var5 * MA(Var6,Var2));
if UpWave[1] then T = 1;
else if DnWave[1] then T = -1;
end;
if T == 1 and T[1] != 1 Then{
H1 = H;
HH = H;
Hi = 0;
if MarketPosition <= 0 and LI >= 10 and LL <= L1-PriceScale*30 then
buy("b",OnClose,def,1);
}
if T == -1 and T[1] != -1 Then{
L1 = L;
LL = L;
Li = 0;
if MarketPosition >= 0 and HI >= 10 and HH >= H1+PriceScale*30 then
sell("s",OnClose,def,1);
}
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
ee = LatestEntryPrice(0);
if CurrentContracts < CurrentContracts[1] Then
ee = LatestExitPrice(0);
if MaxEntries < 5 then
buy("bb",AtStop,LatestEntryPrice(0)+PriceScale*10,1);
ExitLong("bl",AtStop,ee-PriceScale*10,"",1,2);
ExitLong("bp",AtLimit,ee+PriceScale*50);
}
if MarketPosition == -1 Then{
if CurrentContracts > CurrentContracts[1] Then
ee = LatestEntryPrice(0);
if CurrentContracts < CurrentContracts[1] Then
ee = LatestExitPrice(0);
if MaxEntries < 5 then
sell("ss",AtStop,LatestEntryPrice(0)-PriceScale*10,1);
ExitShort("sx",AtStop,ee+PriceScale*10,"",1,2);
ExitShort("sp",AtLimit,ee-PriceScale*50);
}
if T == 1 Then{
Hi = Hi+1;
if H > HH Then
HH = H;
}
if T == -1 Then{
Li = Li+1;
if L < LL Then
LL = L;
}
다음글
이전글