Hall,
könnte bitte jemand diesen Code hier untersuchen:
Ich habe ein Foto in die Anlage gemacht, dass zeigt, dass das Trendfolgesystem mit dem Indikator oft oft gleich nach einem Ausstieg einen neuen Trade eröffnet, obwohl kein wirkliches Signal vor liegt?? Das verstehe ich nicht?? Es steht ja imcode beschrieben dass das HH > sein soll als das HHPrec
Kann man das Ändern?
Im Code stehen Begriffe wie HH und HHPrec, ist es richtig wie ich es im Bild so beschriftet habe, das damit die Punkte im Code gemeint sind??
//defparam calculateonlastbars=30000
ONCE HH = 0
ONCE HHprec = 0
ONCE LL = 0
ONCE LLprec = 0
cp = 3
IF TradePrice = 0 THEN
PositionSize1 = 1
ELSE
PositionSize1 = 1000 / sp //Compute PositionSize
ENDIF
once lastpoint = 0
if high[cp] >= highest[2*cp+1](high) then
PEAK = 1
else
PEAK = 0
endif
if low[cp] <= lowest[2*cp+1](low) then
TROUGH = -1
else
TROUGH = 0
endif
if PEAK = 1 then
TOPy = high[cp]
TOPx = barindex[cp]
endif
if TROUGH = -1 then
BOTy = low[cp]
BOTx = barindex[cp]
endif
if PEAK>0 and (lastpoint=-1 or lastpoint=0) then
//DRAWSEGMENT(lastX,lastY,TOPx,TOPy) COLOURED(127,255,0,1000)
//DRAWTEXT(“■”,TOPx,TOPy,Dialog,Bold,10) coloured(200,0,0,255)
lastpoint = 1
lastX = TOPx
lastY = TOPy
HHprec= HH
HH = TOPy
HHbar = TOPx
endif
if TROUGH<0 and (lastpoint=1 or lastpoint=0) then
//DRAWSEGMENT(lastX,lastY,BOTx,BOTy) COLOURED(255,0,0,255)
//DRAWTEXT(“■”,BOTx,BOTy,Dialog,Bold,10) coloured(0,200,0,255)
lastpoint = -1
lastX = BOTx
lastY = BOTy
LLprec= LL
LL = BOTy
LLbar = BOTx
endif
//TREND ATTEMPT
atr=AverageTrueRange[14](close)
if TOPy > TOPy[1] and topy<>lasttop then
//drawarrowup(barindex,low-atr/2) coloured(0,200,0)
lasttop=topy
trendup = 1
else
trendup = 0
endif
//RETURN TOPy as “TOPy”, BOTY as “BOTy”, trendup as “trendup”
sp = close – 0
// Long
IF not longonmarket and (close > HH) AND (HH > 0) AND (LL > LLprec) AND (LLprec > 0)and (HH > HHprec) and (HH > LL) and (HHprec > LLprec) THEN
BUY Positionsize1 Contract at Market
//SET STOP PRICE LLprec
set stop %loss 50
//SL = abs(close – LL)
TP = Close + (SL * 3)
SET TARGET PRICE TP
LLprec = 0
ENDIF
If longonmarket and Barindex – Tradeindex = 18 THEN
sell at market
ENDIF