Bollinger Bands + RSI + TDI (EURUSD 30M)

Category: Strategies By: elechim Created: July 21, 2020, 5:34 PM
July 21, 2020, 5:34 PM
Strategies
2 Comments

Hello,
I would like to share with you this first strategy that I have just developed. It is based on the Bollinger, RSI and TDI bands largely inspired by Marc website Doctrading (https://www.youtube.com/watch?v=KxTrCc3GmaY) . The results on the EUR/USD pair in 30 minutes look promising.
But it still needs a lot of optimization and hopefully help from you to get it optimized.
See you soon

Michel

// Definizione dei parametri
DEFPARAM FlatBefore = 070000
DEFPARAM FlatAfter = 230000
DEFPARAM preloadbars = 500

// Numero di contratti
Once nlot = 1

// Variabili indicatori
Once perBB = 20
Once perRSI = 9
Once RSIUp = 62
Once RSIDn = 28
Once DMTSLm = 14 // DMT StopLine -> average ATR
Once DMTSLn = 10 // DMT StopLine -> average price
Once lengthRSI = 13 //TDI
Once lengthband = 34 //TDI
Once lengthrsipl = 2 //TDI
Once lengthtradesl = 7 //TDI

// Caricare indicatori
BBup = BollingerUp[perBB](close)
BBDn = BollingerDown[perBB](close)
RSI1 = RSI[perRSI](close)

// -------- Indicatore DMT StopLine --------------
ATR = AverageTrueRange[DMTSLm](close)
avgATR1 = average[DMTSLm](High+ATR)
avgATR2 = average[DMTSLm](Low-ATR)
AVG1 = average[DMTSLn](High)
AVG2 = average[DMTSLn](low)

IF close > AVG1 THEN
BREAKOUT = 1
ELSIF close < AVG2 THEN
BREAKOUT = -1
ENDIF
IF BREAKOUT = -1 AND avgATR1 > avgATR1[1] THEN
avgATR1 = avgATR1[1]
ELSIF BREAKOUT = 1 AND avgATR2 < avgATR2[1] THEN
avgATR2 = avgATR2[1]
ENDIF
IF BREAKOUT = 1 THEN
StopLINE = avgATR2
ELSE
StopLine = avgATR1
ENDIF

// ------- Indicatore TDI ---------
r = rsi[lengthrsi](close)
ma = average[lengthband](r)
offs = (1.6185 * std[lengthband](r))
up = ma+offs
dn = ma-offs
TDI = average[lengthrsipl](r)
TDI2 = average[lengthtradesl](r)

// Variabili di lavoro
Once cdLong1 = 0
Once cdLong2 = 0
Once cdShort1 = 0
Once cdShort2 = 0

//=============== RICERCA ENTRTY ===============
// Long
IF NOT LongOnMarket THEN
IF not cdLong1 AND close < BBdn AND RSI1 < RSIDn AND TDI < dn THEN
cdlong1 = 1
ENDIF
IF not cdlong2 THEN
cdLong2 = TDI > TDI2
ENDIF
IF cdLong1 AND cdLong2 AND StopLine < close THEN
BUY nlot CONTRACTS AT MARKET
SET STOP LOSS (close - StopLine)
cdLong1 = 0
cdLong2 = 0
ENDIF
ENDIF

//Short
IF not ShortOnMarket THEN
IF not cdShort1 AND close > BBUp AND RSI1 > RSIUp AND TDI > up THEN
cdShort1 = 1
ENDIF
IF not cdShort2 THEN
cdShort2 = TDI < TDI2
ENDIF
IF cdShort1 AND cdShort2 AND StopLine > close THEN
SELLSHORT nlot CONTRACTS AT MARKET
SET STOP LOSS (StopLine - close)
cdShort1 = 0
cdShort2 = 0
ENDIF
ENDIF

// =============== USCITA TRAD ===============
//Long
IF LongOnMarket AND close < StopLine THEN
SELL AT MARKET
ENDIF

// Short
IF ShortOnMarket AND close > StopLine THEN
EXITSHORT AT MARKET
ENDIF

 

Download
Filename: BB-Rimbalzi.itf
Downloads: 716
elechim Junior
Operating in the shadows, I hack problems one by one. My bio is currently encrypted by a complex algorithm. Decryption underway...
Author’s Profile

Comments

Logo Logo
Loading...