input : Period(12),DPeriod(28);
var : ADXv(0),DP(0),DM(0),loss(0);
DP = DIPlus(DPeriod);
DM = DIMinus(DPeriod);
ADXv = ADX(Period);
if MarketPosition() == 0 Then{
if ADXv >= 25 and
DP > DM
and
O < L[1] and
C > L[1] Then
buy();
if ADXv >= 25
and
DM > DP and
O > H[1] and
C < H[1]
Then
sell();
}
if MarketPosition() != 0 Then{
if C < L[BarsSinceEntry()]
then
ExitLong();
if C > H[BarsSinceEntry()]
Then
exitshort();
}
댓글 없음:
댓글 쓰기