D
Dowser
I've just discovered automated trading and have been trying to put a system together on IG's Prorealtime. This one is for US30 on M30 T/F and is simplicity itself.
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
x=45
y=54
a=40
b=48
// Conditions to enter long positions
indicator1 = ExponentialAverage[x](close)
indicator2 = ExponentialAverage[y](close)
c1 = (indicator1 CROSSES OVER indicator2)
IF c1 THEN
BUY 1 PERPOINT AT MARKET
ENDIF
// Conditions to exit long positions
indicator3 = ExponentialAverage[x](close)
indicator4 = ExponentialAverage[y](close)
c2 = (indicator3 CROSSES UNDER indicator4)
IF c2 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
indicator5 = ExponentialAverage[a](close)
indicator6 = ExponentialAverage(close)
c3 = (indicator5 CROSSES UNDER indicator6)
IF c3 THEN
SELLSHORT 1 PERPOINT AT MARKET
ENDIF
// Conditions to exit short positions
indicator7 = ExponentialAverage[a](close)
indicator8 = ExponentialAverage(close)
c4 = (indicator7 CROSSES OVER indicator8)
IF c4 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 75
SET TARGET pPROFIT 150
I can back test to August last year but no further. If anybody could test this going back 5 years or so I would be very grateful. The results so far are pretty good. Any suggestions for improvement are most welcome.
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
x=45
y=54
a=40
b=48
// Conditions to enter long positions
indicator1 = ExponentialAverage[x](close)
indicator2 = ExponentialAverage[y](close)
c1 = (indicator1 CROSSES OVER indicator2)
IF c1 THEN
BUY 1 PERPOINT AT MARKET
ENDIF
// Conditions to exit long positions
indicator3 = ExponentialAverage[x](close)
indicator4 = ExponentialAverage[y](close)
c2 = (indicator3 CROSSES UNDER indicator4)
IF c2 THEN
SELL AT MARKET
ENDIF
// Conditions to enter short positions
indicator5 = ExponentialAverage[a](close)
indicator6 = ExponentialAverage(close)
c3 = (indicator5 CROSSES UNDER indicator6)
IF c3 THEN
SELLSHORT 1 PERPOINT AT MARKET
ENDIF
// Conditions to exit short positions
indicator7 = ExponentialAverage[a](close)
indicator8 = ExponentialAverage(close)
c4 = (indicator7 CROSSES OVER indicator8)
IF c4 THEN
EXITSHORT AT MARKET
ENDIF
// Stops and targets
SET STOP pLOSS 75
SET TARGET pPROFIT 150
I can back test to August last year but no further. If anybody could test this going back 5 years or so I would be very grateful. The results so far are pretty good. Any suggestions for improvement are most welcome.