Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Backtesting a technical fx-trading rule

Hi,
Apologies for sounding rudimentary (I have a macro/statistical background) and have been using eviews over the past few years (R in school).
Is there an easy way to backtest the following trend-strategy for fx?

1) Select a time-frame (e.g: 1Y or 5Y)

2) Draw a trend-line connecting highest high to the intermediate high PRECEDING the lowest low (such that no prices between the 2 highs are intersected)

3) If the trend (downtrend) in this case is broken, then check if 200DMA is above price.
a) If Yes, then wait for price to break above 200DMA, then LONG (target highest high, risk lowest low)
b) If 200DMA is below then wait for price to break above intermediate high, then LONG (target highest high, risk lowest low)

Sorry if this sounds confusing but apart from testing this visually, is there a way I could write simple code for this either in eviews/R? Thanks!