Long only strategy for the BUND (1 eur per contract) on a 4 hours timeframe. Backtest with 2 points spread from mid-2010 to now.
Signals are taken from a super smoothed filter (indicator “PRICE ACTION BUND”). Profit are trailed with a soft coded trailing stop in the strategy.
//--------------------------------------------------------------------------------
// STRATEGY BYE BYE BYE BUND
// IG MARKET - FGBL BUND 1 EUR - 4 H - SPREAD 2
DEFPARAM CumulateOrders = false
PositionSize = 1
indicator1, ignored = CALL "PRICE ACTION BUND"
c1 = (indicator1 >= 1)
indicator1, ignored = CALL "PRICE ACTION BUND"
c2 = (indicator1 <=- 1)
indicator1, ignored = CALL "PRICE ACTION BUND"
c3 = (indicator1 crosses over 0)
IF c1 or c2 or c3 AND CurrentDayOfWeek <> 1 THEN
BUY POSITIONSIZE CONTRACT AT MARKET
ENDIF
// TRAILING STOP LOGIK BY KENNETH KVISTAD MODIFIED FOR LONG AND SHORT POSITION
TGL =66
if not onmarket then
MAXPRICE = 0
EXITPRICE = 0
ENDIF
if longonmarket then
MAXPRICE = MAX(MAXPRICE,close)
if MAXPRICE-tradeprice(1)>=TGL*pointsize then
EXITPRICE = MAXPRICE-TGL*pointsize
ENDIF
ENDIF
if onmarket and EXITPRICE>0 then
SELL AT EXITPRICE STOP
ENDIF
SET STOP PLOSS 350
SET TARGET PPROFIT 500
Indicator needed to run the strategy (“PRICE ACTION BUND”)
// UNIVERSAL CODE POSTED BY NICOLAS
// INDICATOR PRICE ACTION BUND
bandedge=50
whitenoise= (Close - Close[50])
if barindex>bandedge then
// super smoother filter
a1= Exp(-1.414 * 3.14159 / bandedge)
b1= 2*a1 * Cos(1.414*180 /bandedge)
c2= b1
c3= -a1 * a1
c1= 1 - c2 - c3
filt= c1 * (whitenoise + whitenoise[1])/2+ c2*filt[1] + c3*filt[1]
filt1 = filt
if ABS(filt1)>pk[1] then
pk = ABS(filt1)
else
pk = 0.99* pk[1]
endif
if pk=0 then
denom = -1
else
denom = pk
endif
if denom = -1 then
result = result[1]
else
result = filt1/pk
endif
endif
RETURN result COLOURED(66,66,205) as "PRICE ACTION", 0 as "0"
You must be logged in to post a comment.
Ciao
miguel, il problema è che non abbiamo periodi short abbastanza lunghi per ottimizzare delle posizioni short, i periodi di discesa hanno sempre avuto rimbalzi, ecco perché anche quando l'indicatore è -1 bisogna comprare.
la soluzione è semplicemente evitare di fare trading sul rimbalzo, e quindi usare solo L' indicatore + 1 e L'indicatore che incrocia a rialzo lo zero.
un altra soluzione è usare un time frame più basso e aprire posizioni più strette. In questo modo si avra modo di usare anche le posizioni short
la prossima strategia che posterò farà proprio questo, sul Dax.
ho postato questa strategia proprio perché vorrei che questa ottima community possa sfruttare L indicatore che da degli ottimi risultati se utilizzato nel modo giusto
Grazie
Hello
Miguel, the problem is that we don’t have long periods of down to optimize the short positions, the drop-down periods of the last 5 years have always had rebounds. In fact, even when the indicator =< -1, the strategy buys.
The solution is to avoid trading on the rebound, and then use only indicator => +1 and when the indicator crosses over the zero.
Another solution is to use a lower time frame to take advantage of little drop-down .
The next strategy that I will post will do just that, on the Dax.
I just posted this strategy because I wish that this great community can take advantage from this indicator and the excellent results when used it in the right way
Thank you
@miguel33 / You are right, but there is also a trailing stop activated @66 points. What you are saying is the main problem of a long only strategy on an instrument we all know is in a bullish trend since many years.
@ALE / maybe a trend filter for long only period would secure the strategy to be activated only in a bullish trend?
Grazie Ale
per aver condiviso con noi il tuo indicatore P.A.B.
aspettiamo il tuo script sul Dax ... con molto interesse !!!