Buongiorno Roberto, potresti cortesemente spiegarmi come codificare un ordine limit a un livello X prestabilito e cancellarlo se il livello non viene raggiunto nelle 3 barre successive?
Ti ringrazio anticipatamente.
Eccolo:
ONCE Entrata = 0
ONCE Barra = 0
IF OnMarket THEN
Barra = 0
Entrata = 0
ENDIF
HH = highest[100](high)
IF HH <> HH[1] THEN
Barra = BarIndex
Entrata = HH
ENDIF
IF Entrata > 0 AND Not OnMarket THEN
IF close > Entrata THEN
Buy 1 Contract at Entrata LIMIT
ELSIF close < Entrata THEN
Buy 1 Contract at Entrata STOP
ELSE
Buy 1 Contract at Market
ENDIF
ENDIF
IF Not OnMarket AND (Entrata > 0) AND (BarIndex - Barra) = 3 THEN
Barra = 0
Entrata = 0
ENDIF
SET STOP pLOSS 100
SET TARGET pPROFIT 200
//graph Not OnMarket AND (Entrata > 0) AND (BarIndex - Barra) < 3
//graph HH <> HH[1] coloured("Red")
Grazie Roberto, gentilissimo come al solito.
Buona giornata.