예스스탁
예스스탁 답변
2016-04-06 18:07:16
안녕하세요
예스스탁입니다.
추가진입하는 식이므로
시스템 적용시 피라미딩탭에서
피라미딩을 다른진입신호만 허용으로 설정하고
적용하시기 바랍니다.
var : T(0),HH(0),LL(0);
var1 = ma(C,20);
var2 = ma(C,60);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition == 0 and T == 1 and NextBarOpen < var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
buy("b",AtStop,NextBarOpen+PriceScale*3,1);
if MarketPosition == 1 and MaxEntries == 1 and T == 1 Then
buy("bb",AtStop,EntryPrice+PriceScale*20,1);
if MarketPosition == 0 and T == -1 and NextBarOpen > var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
sell("s",AtStop,NextBarOpen-PriceScale*3,1);
if MarketPosition == -1 and MaxEntries == 1 and T == -1 Then
sell("ss",AtStop,EntryPrice-PriceScale*20,1);
}
if MarketPosition == 1 Then{
if CurrentContracts == MaxContracts Then
ExitLong("BP",AtLimit,EntryPrice+PriceScale*50,"",1,1);
if countif(CrossDown(c,var1),BarsSinceEntry) >= 1 and
countif(C<var1,5) == 5 Then
exitlong("Bx");
ExitLong("BL",AtStop,EntryPrice-PriceScale*25);
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if HH >= avgEntryPrice+PriceScale*20 Then{
ExitLong("btr",AtStop,avgEntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
if CurrentContracts == MaxContracts Then
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
if countif(Crossup(c,var1),BarsSinceEntry) >= 1 and
countif(C>var1,5) == 5 Then
ExitShort("Sx");
ExitShort("sl",AtStop,EntryPrice+PriceScale*25);
if CurrentContracts > CurrentContracts[1] Then
LL = L;
if L < LL Then
LL = L;
if LL <= avgEntryPrice-PriceScale*20 Then{
ExitShort("str",AtStop,AvgEntryPrice-PriceScale*1);
}
}
즐거운 하루되세요
> 상중하 님이 쓴 글입니다.
> 제목 : 수식 수정 부탁합니다.
> 안녕하세요?
만들어주신 수식입니다.
1번조건에 어제 만들어 주신 2번 청산조건을 수정할려고 하니 잘안되어서 문의 드립니다.
기존 청산조건 수정 부탁드립니다.
기존청산조건;
익절:50
손절:25
stop:+20수익후 +1틱에 stop
수정요청내용;
1) 진입조건
기존동일하구요
① 진입신호 유지시 -20틱일때 추가 한계약.
진입신호 이탈시 추가매수 안함.
(예를 들어 매수시 60MA가 상승기울기인데 -20일때 상승기울기이면 추가 한계약
하락 기울기 이면 추가 매수 안함_현재가기준)
② 매매시작은 진입신호 발생시 진입하고 그이후 익절이든 손절이든 청산후
5개봉이후부터 신호발생시 진입
2)청산조건.
익절 :한계약은 기존동일하구요 나머지 한계약은
60 이평선을 이탈(돌파)후 5개째봉에서 재 돌파하지 못하면 청산.
이때 매수후 청산전까지 진입신호는 나오지 않게 부탁합니다.
손절:25
stop:+20수익후 +1틱에 stop(2게약모두청산)
항상 감사드립니다.
1.
var : T(0);
var1 = ma(C,20);
var2 = ma(C,60);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition <= 0 and T == 1 and NextBarOpen < var1 Then
buy("b",AtStop,NextBarOpen+PriceScale*3,2);
if MarketPosition >= 0 and T == -1 and NextBarOpen > var1 Then
sell("s",AtStop,NextBarOpen-PriceScale*3,2);
}
if MarketPosition == 1 Then{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1);
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*100);
ExitLong("bl",AtStop,EntryPrice-PriceScale*25);
if CurrentContracts == MaxContracts and highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then{
ExitLong("bx1",AtStop,EntryPrice+PriceScale*1);
}
if CurrentContracts < MaxContracts Then{
ExitLong("bx2",AtStop,EntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100);
ExitShort("sl",AtStop,EntryPrice+PriceScale*25);
if CurrentContracts == MaxContracts and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*20 Then{
ExitShort("sx1",AtStop,EntryPrice-PriceScale*1);
}
if CurrentContracts < MaxContracts Then{
ExitShort("sx2",AtStop,EntryPrice-PriceScale*1);
}
}
2.
var1 = ma(C,60);
if MarketPosition == 1 and
countif(CrossDown(c,var1),BarsSinceEntry) >= 1 and
countif(C<var1,5) == 5 Then
exitlong();
if MarketPosition == -1 and
countif(Crossup(c,var1),BarsSinceEntry) >= 1 and
countif(C>var1,5) == 5 Then
ExitShort();
진입후 청산전까지 진입신호 무시는 진입식에 조건을 추가하셔야 합니다.
사용하는 수식의 지입조건식에 MarketPosition == 0 조건을 추가하시면 됩니다.
죄송합니다.
매매를 하면서 질문을 드려서 설명이 부족한것 같습니다.
수식 수정 부탁드립니다.
1. 추가진입포지션 틱부호가 반대로 수정부탁합니다.(사진1 참고)
매수 -20틱,매도 +20틱으로 수정.
2. 추세포지션 청산위치 60MA로 수정 해주시고 차트상에서도 변수로 수정 할수 있게
부탁합니다.(그림2참고)
3. 3차나 4차 추가진입시 수정하는 방법좀 알려주시거나 시간되시면
만들어 주시면 감사드리구요.
진입;
1차 진입
2차 -20틱일때 손실시 추가 1계약
3차 2차 진입합계에서 -20틱일때 추가 2계약
4차 3차 진입합계에서 -20틱일때 추가 4계약
청산;
1차 진입분: +50틱시 청산.
2차 진입 발생시(총2계약): 1계약 +50 틱청산/1계약은 60MA이탈(돌파)후 5개째봉
60MA 되돌림 나오지 않으면 청산.
3차 진입 발생시(총4계약): 2계약 +50 틱청산/2계약 60MA이탈(돌파)후 5개째봉
60MA 되돌림 나오지 않으면 청산.
4차 진입 발생시(총4계약): 4계약 +50 틱청산/4계약 60MA이탈(돌파)후 5개째봉
60MA 되돌림 나오지 않으면 청산.
올청산조건은 60MA 이탈이나 돌파시 올청입니다.
랭기지에서 편집하지 않고 차트상에서 바로 변수조절할수 있게 부탁드립니다(3가지).
① 1차 목표 수익:현재 50 (틱).
② 2차청산분의 MA위치: 현재 60 (MA).
③ 매매시작은 진입신호 발생시 진입하고 그이후 익절이든 손절이든 청산후
5 개봉이후부터 신호발생시 진입 :현재 5
3가지는 변수 조절할수있게 부탁합니다.
2번째 변수를 변경해도 진입식에 영향받지 않도록 부탁드려요.
저가 해볼려고 바꾸니까 진입조건까지 같이 변경이 되어서 요청드려요.
생각보다 시스템 트레이딩이 어렵네요.
너무 귀찮게 해서 죄송합니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 수정 부탁합니다.
>
안녕하세요
예스스탁입니다.
추가진입하는 식이므로
시스템 적용시 피라미딩탭에서
피라미딩을 다른진입신호만 허용으로 설정하고
적용하시기 바랍니다.
var : T(0),HH(0),LL(0);
var1 = ma(C,20);
var2 = ma(C,60);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition == 0 and T == 1 and NextBarOpen < var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
buy("b",AtStop,NextBarOpen+PriceScale*3,1);
if MarketPosition == 1 and MaxEntries == 1 and T == 1 Then
buy("bb",AtStop,EntryPrice+PriceScale*20,1);
if MarketPosition == 0 and T == -1 and NextBarOpen > var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
sell("s",AtStop,NextBarOpen-PriceScale*3,1);
if MarketPosition == -1 and MaxEntries == 1 and T == -1 Then
sell("ss",AtStop,EntryPrice-PriceScale*20,1);
}
if MarketPosition == 1 Then{
if CurrentContracts == MaxContracts Then
ExitLong("BP",AtLimit,EntryPrice+PriceScale*50,"",1,1);
if countif(CrossDown(c,var1),BarsSinceEntry) >= 1 and
countif(C<var1,5) == 5 Then
exitlong("Bx");
ExitLong("BL",AtStop,EntryPrice-PriceScale*25);
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if HH >= avgEntryPrice+PriceScale*20 Then{
ExitLong("btr",AtStop,avgEntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
if CurrentContracts == MaxContracts Then
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
if countif(Crossup(c,var1),BarsSinceEntry) >= 1 and
countif(C>var1,5) == 5 Then
ExitShort("Sx");
ExitShort("sl",AtStop,EntryPrice+PriceScale*25);
if CurrentContracts > CurrentContracts[1] Then
LL = L;
if L < LL Then
LL = L;
if LL <= avgEntryPrice-PriceScale*20 Then{
ExitShort("str",AtStop,AvgEntryPrice-PriceScale*1);
}
}
즐거운 하루되세요
> 상중하 님이 쓴 글입니다.
> 제목 : 수식 수정 부탁합니다.
> 안녕하세요?
만들어주신 수식입니다.
1번조건에 어제 만들어 주신 2번 청산조건을 수정할려고 하니 잘안되어서 문의 드립니다.
기존 청산조건 수정 부탁드립니다.
기존청산조건;
익절:50
손절:25
stop:+20수익후 +1틱에 stop
수정요청내용;
1) 진입조건
기존동일하구요
① 진입신호 유지시 -20틱일때 추가 한계약.
진입신호 이탈시 추가매수 안함.
(예를 들어 매수시 60MA가 상승기울기인데 -20일때 상승기울기이면 추가 한계약
하락 기울기 이면 추가 매수 안함_현재가기준)
② 매매시작은 진입신호 발생시 진입하고 그이후 익절이든 손절이든 청산후
5개봉이후부터 신호발생시 진입
2)청산조건.
익절 :한계약은 기존동일하구요 나머지 한계약은
60 이평선을 이탈(돌파)후 5개째봉에서 재 돌파하지 못하면 청산.
이때 매수후 청산전까지 진입신호는 나오지 않게 부탁합니다.
손절:25
stop:+20수익후 +1틱에 stop(2게약모두청산)
항상 감사드립니다.
1.
var : T(0);
var1 = ma(C,20);
var2 = ma(C,60);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition <= 0 and T == 1 and NextBarOpen < var1 Then
buy("b",AtStop,NextBarOpen+PriceScale*3,2);
if MarketPosition >= 0 and T == -1 and NextBarOpen > var1 Then
sell("s",AtStop,NextBarOpen-PriceScale*3,2);
}
if MarketPosition == 1 Then{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1);
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*100);
ExitLong("bl",AtStop,EntryPrice-PriceScale*25);
if CurrentContracts == MaxContracts and highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then{
ExitLong("bx1",AtStop,EntryPrice+PriceScale*1);
}
if CurrentContracts < MaxContracts Then{
ExitLong("bx2",AtStop,EntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100);
ExitShort("sl",AtStop,EntryPrice+PriceScale*25);
if CurrentContracts == MaxContracts and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*20 Then{
ExitShort("sx1",AtStop,EntryPrice-PriceScale*1);
}
if CurrentContracts < MaxContracts Then{
ExitShort("sx2",AtStop,EntryPrice-PriceScale*1);
}
}
2.
var1 = ma(C,60);
if MarketPosition == 1 and
countif(CrossDown(c,var1),BarsSinceEntry) >= 1 and
countif(C<var1,5) == 5 Then
exitlong();
if MarketPosition == -1 and
countif(Crossup(c,var1),BarsSinceEntry) >= 1 and
countif(C>var1,5) == 5 Then
ExitShort();
진입후 청산전까지 진입신호 무시는 진입식에 조건을 추가하셔야 합니다.
사용하는 수식의 지입조건식에 MarketPosition == 0 조건을 추가하시면 됩니다.
예스스탁
예스스탁 답변
2016-04-07 13:54:22
안녕하세요
예스스탁입니다.
1.
input : P1(20),P2(60),목표수익1차틱수(50),손절틱수(25),청산이평기간(60);
var : T(0),HH(0),LL(0);
var1 = ma(C,P1);
var2 = ma(C,P2);
var3 = ma(C,청산이평기간);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition == 0 and T == 1 and NextBarOpen < var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
buy("b",AtStop,NextBarOpen+PriceScale*3,1);
if MarketPosition == 1 and MaxEntries == 1 and T == 1 Then
buy("b1",AtLimit,AvgEntryPrice-PriceScale*20,1);
if MarketPosition == 0 and T == -1 and NextBarOpen > var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
sell("s",AtStop,NextBarOpen-PriceScale*3,1);
if MarketPosition == -1 and MaxEntries == 1 and T == -1 Then
sell("s1",AtLimit,AvgEntryPrice+PriceScale*20,1);
}
if MarketPosition == 1 Then{
if CurrentContracts == MaxContracts Then
ExitLong("BP",AtLimit,EntryPrice+PriceScale*목표수익1차틱수,"",max(Floor(CurrentContracts*0.5),1),1);
if countif(CrossDown(c,var3),BarsSinceEntry) >= 1 and
countif(C<var3,5) == 5 Then
exitlong("Bx");
ExitLong("BL",AtStop,EntryPrice-PriceScale*손절틱수);
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if HH >= avgEntryPrice+PriceScale*20 Then{
ExitLong("btr",AtStop,avgEntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
if CurrentContracts == MaxContracts Then
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*목표수익1차틱수,"",max(Floor(CurrentContracts*0.5),1),1);
if countif(Crossup(c,var3),BarsSinceEntry) >= 1 and
countif(C>var3,5) == 5 Then
ExitShort("Sx");
ExitShort("sl",AtStop,EntryPrice+PriceScale*손절틱수);
if CurrentContracts > CurrentContracts[1] Then
LL = L;
if L < LL Then
LL = L;
if LL <= avgEntryPrice-PriceScale*20 Then{
ExitShort("str",AtStop,AvgEntryPrice-PriceScale*1);
}
}
2
input : P1(20),P2(60),목표수익1차틱수(50),손절틱수(25),청산이평기간(60),추가진입횟수(3);
var : T(0),HH(0),LL(0);
var1 = ma(C,P1);
var2 = ma(C,P2);
var3 = ma(C,청산이평기간);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition == 0 and T == 1 and NextBarOpen < var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
buy("b",AtStop,NextBarOpen+PriceScale*3,1);
if MarketPosition == 1 and MaxEntries <= 추가진입횟수 and T == 1 Then
buy("bb",AtLimit,AvgEntryPrice-PriceScale*20,CurrentContracts);
if MarketPosition == 0 and T == -1 and NextBarOpen > var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
sell("s",AtStop,NextBarOpen-PriceScale*3,1);
if MarketPosition == -1 and MaxEntries == 1 and T == -1 Then
sell("s1",AtLimit,AvgEntryPrice+PriceScale*20,CurrentContracts);
}
if MarketPosition == 1 Then{
if CurrentContracts == MaxContracts Then
ExitLong("BP",AtLimit,EntryPrice+PriceScale*목표수익1차틱수,"",max(Floor(CurrentContracts*0.5),1),1);
if countif(CrossDown(c,var3),BarsSinceEntry) >= 1 and
countif(C<var3,5) == 5 Then
exitlong("Bx");
ExitLong("BL",AtStop,EntryPrice-PriceScale*손절틱수);
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if HH >= avgEntryPrice+PriceScale*20 Then{
ExitLong("btr",AtStop,avgEntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
if CurrentContracts == MaxContracts Then
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*목표수익1차틱수,"",max(Floor(CurrentContracts*0.5),1),1);
if countif(Crossup(c,var3),BarsSinceEntry) >= 1 and
countif(C>var3,5) == 5 Then
ExitShort("Sx");
ExitShort("sl",AtStop,EntryPrice+PriceScale*손절틱수);
if CurrentContracts > CurrentContracts[1] Then
LL = L;
if L < LL Then
LL = L;
if LL <= avgEntryPrice-PriceScale*20 Then{
ExitShort("str",AtStop,AvgEntryPrice-PriceScale*1);
}
}
즐거운 하루되세요
> 상중하 님이 쓴 글입니다.
> 제목 : Re : Re : 수식 수정 부탁합니다.
> 죄송합니다.
매매를 하면서 질문을 드려서 설명이 부족한것 같습니다.
수식 수정 부탁드립니다.
1. 추가진입포지션 틱부호가 반대로 수정부탁합니다.(사진1 참고)
매수 -20틱,매도 +20틱으로 수정.
2. 추세포지션 청산위치 60MA로 수정 해주시고 차트상에서도 변수로 수정 할수 있게
부탁합니다.(그림2참고)
3. 3차나 4차 추가진입시 수정하는 방법좀 알려주시거나 시간되시면
만들어 주시면 감사드리구요.
진입;
1차 진입
2차 -20틱일때 손실시 추가 1계약
3차 2차 진입합계에서 -20틱일때 추가 2계약
4차 3차 진입합계에서 -20틱일때 추가 4계약
청산;
1차 진입분: +50틱시 청산.
2차 진입 발생시(총2계약): 1계약 +50 틱청산/1계약은 60MA이탈(돌파)후 5개째봉
60MA 되돌림 나오지 않으면 청산.
3차 진입 발생시(총4계약): 2계약 +50 틱청산/2계약 60MA이탈(돌파)후 5개째봉
60MA 되돌림 나오지 않으면 청산.
4차 진입 발생시(총4계약): 4계약 +50 틱청산/4계약 60MA이탈(돌파)후 5개째봉
60MA 되돌림 나오지 않으면 청산.
올청산조건은 60MA 이탈이나 돌파시 올청입니다.
랭기지에서 편집하지 않고 차트상에서 바로 변수조절할수 있게 부탁드립니다(3가지).
① 1차 목표 수익:현재 50 (틱).
② 2차청산분의 MA위치: 현재 60 (MA).
③ 매매시작은 진입신호 발생시 진입하고 그이후 익절이든 손절이든 청산후
5 개봉이후부터 신호발생시 진입 :현재 5
3가지는 변수 조절할수있게 부탁합니다.
2번째 변수를 변경해도 진입식에 영향받지 않도록 부탁드려요.
저가 해볼려고 바꾸니까 진입조건까지 같이 변경이 되어서 요청드려요.
생각보다 시스템 트레이딩이 어렵네요.
너무 귀찮게 해서 죄송합니다.
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 수정 부탁합니다.
>
안녕하세요
예스스탁입니다.
추가진입하는 식이므로
시스템 적용시 피라미딩탭에서
피라미딩을 다른진입신호만 허용으로 설정하고
적용하시기 바랍니다.
var : T(0),HH(0),LL(0);
var1 = ma(C,20);
var2 = ma(C,60);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition == 0 and T == 1 and NextBarOpen < var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
buy("b",AtStop,NextBarOpen+PriceScale*3,1);
if MarketPosition == 1 and MaxEntries == 1 and T == 1 Then
buy("bb",AtStop,EntryPrice+PriceScale*20,1);
if MarketPosition == 0 and T == -1 and NextBarOpen > var1 and
(TotalTrades == 0 or TotalTrades >= 1 and BarsSinceExit(1) >= 5) Then
sell("s",AtStop,NextBarOpen-PriceScale*3,1);
if MarketPosition == -1 and MaxEntries == 1 and T == -1 Then
sell("ss",AtStop,EntryPrice-PriceScale*20,1);
}
if MarketPosition == 1 Then{
if CurrentContracts == MaxContracts Then
ExitLong("BP",AtLimit,EntryPrice+PriceScale*50,"",1,1);
if countif(CrossDown(c,var1),BarsSinceEntry) >= 1 and
countif(C<var1,5) == 5 Then
exitlong("Bx");
ExitLong("BL",AtStop,EntryPrice-PriceScale*25);
if CurrentContracts > CurrentContracts[1] Then
HH = H;
if H > HH Then
HH = H;
if HH >= avgEntryPrice+PriceScale*20 Then{
ExitLong("btr",AtStop,avgEntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
if CurrentContracts == MaxContracts Then
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
if countif(Crossup(c,var1),BarsSinceEntry) >= 1 and
countif(C>var1,5) == 5 Then
ExitShort("Sx");
ExitShort("sl",AtStop,EntryPrice+PriceScale*25);
if CurrentContracts > CurrentContracts[1] Then
LL = L;
if L < LL Then
LL = L;
if LL <= avgEntryPrice-PriceScale*20 Then{
ExitShort("str",AtStop,AvgEntryPrice-PriceScale*1);
}
}
즐거운 하루되세요
> 상중하 님이 쓴 글입니다.
> 제목 : 수식 수정 부탁합니다.
> 안녕하세요?
만들어주신 수식입니다.
1번조건에 어제 만들어 주신 2번 청산조건을 수정할려고 하니 잘안되어서 문의 드립니다.
기존 청산조건 수정 부탁드립니다.
기존청산조건;
익절:50
손절:25
stop:+20수익후 +1틱에 stop
수정요청내용;
1) 진입조건
기존동일하구요
① 진입신호 유지시 -20틱일때 추가 한계약.
진입신호 이탈시 추가매수 안함.
(예를 들어 매수시 60MA가 상승기울기인데 -20일때 상승기울기이면 추가 한계약
하락 기울기 이면 추가 매수 안함_현재가기준)
② 매매시작은 진입신호 발생시 진입하고 그이후 익절이든 손절이든 청산후
5개봉이후부터 신호발생시 진입
2)청산조건.
익절 :한계약은 기존동일하구요 나머지 한계약은
60 이평선을 이탈(돌파)후 5개째봉에서 재 돌파하지 못하면 청산.
이때 매수후 청산전까지 진입신호는 나오지 않게 부탁합니다.
손절:25
stop:+20수익후 +1틱에 stop(2게약모두청산)
항상 감사드립니다.
1.
var : T(0);
var1 = ma(C,20);
var2 = ma(C,60);
if var2 > var2[1] Then
T = 1;
if var2 < var2[1] Then
T = -1;
if stime >= 230000 or stime < 030000 then{
if MarketPosition <= 0 and T == 1 and NextBarOpen < var1 Then
buy("b",AtStop,NextBarOpen+PriceScale*3,2);
if MarketPosition >= 0 and T == -1 and NextBarOpen > var1 Then
sell("s",AtStop,NextBarOpen-PriceScale*3,2);
}
if MarketPosition == 1 Then{
ExitLong("bp1",AtLimit,EntryPrice+PriceScale*50,"",1,1);
ExitLong("bp2",AtLimit,EntryPrice+PriceScale*100);
ExitLong("bl",AtStop,EntryPrice-PriceScale*25);
if CurrentContracts == MaxContracts and highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*20 Then{
ExitLong("bx1",AtStop,EntryPrice+PriceScale*1);
}
if CurrentContracts < MaxContracts Then{
ExitLong("bx2",AtStop,EntryPrice+PriceScale*1);
}
}
if MarketPosition == -1 Then{
ExitShort("sp1",AtLimit,EntryPrice-PriceScale*50,"",1,1);
ExitShort("sp2",AtLimit,EntryPrice-PriceScale*100);
ExitShort("sl",AtStop,EntryPrice+PriceScale*25);
if CurrentContracts == MaxContracts and Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*20 Then{
ExitShort("sx1",AtStop,EntryPrice-PriceScale*1);
}
if CurrentContracts < MaxContracts Then{
ExitShort("sx2",AtStop,EntryPrice-PriceScale*1);
}
}
2.
var1 = ma(C,60);
if MarketPosition == 1 and
countif(CrossDown(c,var1),BarsSinceEntry) >= 1 and
countif(C<var1,5) == 5 Then
exitlong();
if MarketPosition == -1 and
countif(Crossup(c,var1),BarsSinceEntry) >= 1 and
countif(C>var1,5) == 5 Then
ExitShort();
진입후 청산전까지 진입신호 무시는 진입식에 조건을 추가하셔야 합니다.
사용하는 수식의 지입조건식에 MarketPosition == 0 조건을 추가하시면 됩니다.