커뮤니티
시스템식 문의
2012-06-07 23:46:33
286
글번호 51713
늘 감사드립니다.
답변 1
예스스탁 예스스탁 답변
2012-06-07 15:26:34
안녕하세요
예스스탁입니다.
피라미딩되는 식은 모두 다른진입신호만 허용으로 하시면 됩니다.
1.
input : K(10),N(1);
var : cnt(0),count(0),entry(0),Loss(0);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
Loss = 0;
for cnt = 20 downto 1{
if sdate == exitDate(cnt) and PositionProfit(cnt) < 0 Then
Loss = loss+1;
Else
loss = 0;
}
if loss == 0 Then
entry = N;
if loss == 1 Then
entry = N*2;
if loss == 2 Then
entry = N*3;
if loss >= 3 Then
entry = N*4;
if MarketPosition == 0 and count < 10 and CrossDown(c,ma(c,5)) /*조건B and Countif(조건A,K) >= 1*/ Then
sell("s",OnClose,def,entry);
if MarketPosition == -1 Then{
ExitShort("sx1",atlimit,EntryPrice-PriceScale*10);
ExitShort("sx2",AtStop,EntryPrice+PriceScale*8);
ExitShort("sx3",AtStop,highest(H,3));
}
2.
if MarketPosition == 0 and 조건A Then
sell("s1");
if MarketPosition == 1 and 조건A Then{
sell("s2",AtStop,EntryPrice-PriceScale*5);
sell("s3",AtStop,EntryPrice-PriceScale*10);
}
if 조건B Then
ExitShort();
3.
if MarketPosition == 0 and C <= dayopen-PriceScale*20 Then
sell("s1",OnClose,def,5);
if MarketPosition == -1 and BarsSinceEntry < 30 and stime < 150000 Then{
sell("s2",AtLimit,EntryPrice+PriceScale*5,5);
sell("s3",AtLimit,EntryPrice+PriceScale*10,5);
sell("s4",AtLimit,EntryPrice+PriceScale*15,5);
sell("s5",AtLimit,EntryPrice+PriceScale*20,5);
ExitShort("sx2",atlimit,EntryPrice-PriceScale*50);
if lowest(L,BarsSinceEntry) < EntryPrice-PriceScale*30 Then{
if countif(C>O and C > C[1],2) == 2 Then{
ExitShort("sx3");
}
ExitShort("sx4",AtStop,highest(H,3));
}
}
if MarketPosition == -1 and BarsSinceEntry >= 2 and countif(C > dayopen,2) == 2 Then
ExitShort("sx1");
즐거운 하루되세요
> 에구머니 님이 쓴 글입니다.
> 제목 : 시스템식 문의
> 늘 감사드립니다.