예스스탁
예스스탁 답변
2016-04-07 14:33:53
안녕하세요
예스스탁입니다.
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);
}
}
즐거운 하루되세요
> 상중하 님이 쓴 글입니다.
> 제목 : 47140 댓글 한번봐주세요?
> 댓글 확인 부탁합니다.