Hello,
I’m wondering if someone would be nice enough help me translate an indicator into a Probacktest.
Indicator is based on Bill Williams fractals and places markers on the graph. I’d like to open positions on these markers :
signal = 0
// Fractals N candles
Ncandles = 5
// N Candles each side extreme candle
Nside = (Ncandles - 1) / 2
// Sup fractal definition
IF high[Nside] >= highest[Ncandles](high) THEN
Fup = high[Nside]
signal = -1
ENDIF
// Inf fractal def
IF low[Nside] <= lowest[Ncandles](low) THEN
Fdown = low[Nside]
signal = 1
ENDIF
// Draw signals
IF signal = 1 THEN
DRAWARROWUP(barindex[2],low[2]-Averagetruerange[5]/3)coloured(0,150,0)
ELSIF signal = -1 THEN
DRAWARROWDOWN(barindex[2],high[2]+Averagetruerange[5]/3)coloured(255,0,0)
ENDIF
Return Fup as "Fup", Fdown as "Fdown"
I’d like to open following positions :
On signal Fup, buy 1 shares at market / take profit @ 0.3% / Stop loss @ 0.10%
On signal Fdown, sell short 1 shares at market / take profit @ 0.3% / Stop loss @ 0.10%
Many thanks in advance !
The strategy coded in this topic is exactly what you are requesting for: https://www.prorealcode.com/topic/fractal-systeme/
It deals with entries made after new fractals are discovered.