2013년 6월 22일 토요일

1-2-3-4'S 시스템

Input : Period(14),N(10);
var :DP(0),DM(0),loss(0);

DP = DIPlus(Period);
DM = DIMinus(Period);
var1 = ADX(Period);

if MarketPosition() == 0 Then{
 if var1 >= 25 and
  DP > DM and
  ((L[1] < L[2] and L[2] < L[3] and H[1] < H[2] and H[2] < H[3]) or
  (L[1] > L[2] and L[2] < L[3] and H[1] < H[2] and H[2] < H[3])) Then
  Buy("매수",AtStop,H);
 if var1 >= 25 and
  DM > DP and
  ((L[1] > L[2] and L[2] > L[3] and H[1] > H[2] and H[2] > H[3]) or
  (L[1] > L[2] and L[2] > L[3] and H[1] < H[2] and H[2] > H[3])) Then
  Sell("매도",atstop,L);
}

if MarketPosition() == 1 and C <= loss Then
 exitlong("매수청산",AtStop,L[BarsSinceEntry()]);
if MarketPosition() == -1 and C >= loss Then
 exitshort("매도청산",atstop,H[BarsSinceEntry()]);

SetStopProfittarget(PriceScale*N,PointStop);//N틱 목표이익 청산

댓글 없음:

댓글 쓰기