This is my first autosystem, thanks to the many people in this web that help me with it. I designed it with the idea of being versatile so it can work within bulls, bears and neutrals periods, also with different markets, timeframes or indicators. I put here one of the setups I designed but I have tried others with similar results in backtesting, e.g. DOW-15m-MACD.
There´s not size management. I have tried roughly several approachs but I was not convinced about them. I decided to leave the size of the positions to the monetary circumstances of each one. Also it can be a good topic to contribute ideas here.
I can only backtest with 100k candles, it would be nice if someone can do it before that.
To use you need to import in PRT the Divergence Indicator “Divergence-RSI-V3.itf” and the system itself “The Grinder-EUSD-5M-v0.itf”
SETUP:
HOW IT WORKS:
// System parameters
DEFPARAM CumulateOrders = False
DEFPARAM PRELOADBARS = 2000
DEFPARAM FLATBEFORE = 080000
DEFPARAM FLATAFTER = 190000
LimitEntryTime = 184000 //No Entries after this time
// Divergence Indicator RSI
ignored, DRSI = CALL "Divergence RSI v3"[24,8,1,0]
BullishDivergence = DRSI = 1
BearishDivergence = DRSI = -1
// Filter to avoid entries on a trend (Delayed Donchian Canal with a Margin)
NotBearTrend = LOWEST[120](close[15]) < (close+((close*SafetyMargin)/100))
NotBullTrend = HIGHEST[120](close[15]) > (close-((close*SafetyMargin)/100))
SafetyMargin = 0.15
// Conditions for Entry of Long Positions
IF BullishDivergence AND NotBearTrend AND OPENTIME<=LimitEntryTime THEN
BUY 1 CONTRACTS AT MARKET
ELSIF SHORTONMARKET AND ((CLOSE-TRADEPRICE)/TRADEPRICE)*100 > FlipPosition THEN// Change from short to long position when the FlipPosition Stop reached, because a trend is underway
BUY 1 CONTRACTS AT MARKET
ENDIF
// Conditions for Entry of Short Positions
IF BearishDivergence AND NotBullTrend AND OPENTIME<=LimitEntryTime THEN
SELLSHORT 1 CONTRACTS AT MARKET
ELSIF LONGONMARKET AND ((CLOSE-TRADEPRICE)/TRADEPRICE)*100 < -FlipPosition THEN// Change from long to short position when the FlipPosition Stop reached, because a trend is underway
SELLSHORT 1 CONTRACTS AT MARKET
ENDIF
// Loss, Profit and Flip Stops
SET STOP %LOSS 3 // Not used because the Flip Stop is lower, just in case.
SET TARGET %PROFIT 3
FlipPosition = 1.5 // It this %Loss is reached the position turns in the opposite direction (Long->Short or Short->Long)
// END