Hello fellow traders,
I have been monitoring this wonderful site for nearly one year now, admired the work of a number of experienced and creative minds.
I would now like to share a piece of code with out that my wife, Dominique, and I have developed.
We have tried the code live since January 6th on te DAX 1 minute and it has generated 260 Euros with a DAX mini 1 Euro CFD system, trading long only. I admit that I have aborted two trades going the wrong way manually.
The code relies on the crossing of linear regression lines, augmented with a factor a or b to define the steepness or angle of the crossing (the steeper, the more bullish),
combined with RSI and the Schaff Trend Cycle Index. We have also tried other indices for trent, such as the TDI, the ‘Bluster DAX’ and a lot of others, but the Schaff Trend Cycle Index in our opinion performs best.
The code is designed to take whatever profit as soon as it get’s later than 17.45, provided that we are making any profit. This is to avoid higher spreads. This codes has been tested using a spread of 0,8, which is normal DAX spread during the office hours. We specifically don’t want to go overnight, although it as happened.
All parameters have been optimized for the last 6 weeks, which have been rather annoying, given the horizontal progression of the DAX, but that’s life.
We also have a ‘short’ version of this code, but it doesn’t work as good.
We have also tried to combine our entry with CTFA’s grid trading and money managing strategy (congratulations on this one, by the way), but we have found that a simple take profit and stop loss renders the most profit. Perhaps you can do it.
So, here it is. We hope that you will be able to improve this code and -who knows- combine with an efficient short version and/or money management strategy.
Greetings from the ‘hell hole’ Belgium. “It’s tremendous”. Time zone is GMT +1
Glen
//-------------------------------------------------------------------------
// Main code : DAX DOMI LONG 03/02/2017
//-------------------------------------------------------------------------
DEFPARAM CumulateOrders = true
// Definition of indicators
purple = LinearRegression[7](close)
blue = LinearRegression[10](close)
yellow = LinearRegression[40] (close)
a = 1
b = 0
indicator1 = RSI[31](close)
indicator2 = time
// Schaff Trend Cycle
MCD = WilderAverage[20] - WilderAverage[50]
ST =( MCD-LOWEST[3] (MCD) )/(HIGHEST[3] (MCD)-LOWEST[3] (MCD) )*100
STC = WilderAverage [round(3/2)] (ST)
// Conditions to enter long positions
c1 = (purple > (blue + a))
c2 = (close > (blue + b))
c3 = (close > close[1])
c4 = (blue > blue[5])
c5 = CountOfPosition <=3
c6 = (indicator1 < 70)
c7 = (indicator1 > 49)
c8 = (indicator2 > 080000)
c9 = (indicator2 < 161500)
c10 = STC > 27
c11= STC > STC [5]
IF c1 AND c2 AND c3 AND c4 AND c5 AND c6 AND c7 AND c8 AND c9 AND c10 AND c11 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
IF LONGONMARKET AND (time > 174500) AND (PositionPerf > 0) THEN
SELL AT MARKET
ENDIF
IF LONGONMARKET AND (yellow > (purple + 20)) THEN
SELL AT MARKET
ENDIF
// Stops and targets
SET TARGET pPROFIT 25
SET STOP pLOSS 135