Hi there,
I would like to backtest a trading system that uses a buysignal consisting of the following sequence of events in the daily chart:
1. if 6 period ema crosses above 34 period ema
2. and then price closes below 6 period ema while 6 period ema is still above 34 period ema
3. and then price closes above the highest high since the 6 period ema initially crossed above the 34 period ema while 6 period ema still above 34 period ema
4. then buy 1 contract
5. sell when price closes below 34 period ema
When searching in the forum I can find some examples of sequence of events in trading system code, but I am not able to figure out how to code this based on what I can find.
Would anyone like to help?