PDA

View Full Version : Could anyone back test this code for me?



hibspogy58
06-17-2016,
I've just discovered automated trading and have been trying to put a system together on IG (http://www.trade2win.com/boards/autolink.php?id=10&forumid=164&script=showthread)'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)

huhfartp30
06-18-2016,
Why can't you backtest prior to August? When you say "US30" do you mean the Dow 30? You could download years of historical data on that quite easily (such as Yahoo Finance, for example).

Your algorithm appears to use an (exponential) moving average crossovers to generate buy/sell signals. Yes, that is "simplicity itself." Maybe too simple. If you're going to do algorithmic trading, I suggest reading Ernie Chan's book, "Algorithmic Trading - Winning Strategies and Their Rationale".

ibtryhoq96
06-19-2016,
I can't back test prior to August because that's as far back as the data goes on my spread bet platform on the 30 minute time frame. Yes I'm referring to the Dow. I think the years of historical data on Yahoo is Daily OHLC, but I will double check. It maybe too simple and that's why I'm trying to back test for a longer period of time.

iduxpazubv
06-21-2016,
Ten months of 30-minute data should be about 2000 data points, by my calculation. That should be sufficient to back test. If you're not seeing a decent return with backtesting that data set, then it might be best to drop the strategy.

ihsttcwn79
06-22-2016,
The point is I am seeing a very decent return. I just worried it's too good to be true!