Dear
I found this trading strategy in a blog in the web by someone : It says:
The first component of this formula is to determine the trend. What you want are the daily moving averages in three time frames: the 10 day MA, 20 day MA, and 50 day MA. Here is the first part of the formula: 10 day MA > 20 day MA > 50 day MA. In other words the 10 day MA is higher than the 20 day MA which in turn is higher than the 50 day MA. If the stock you are looking at meets this criteria, then move on to the next component in this formula. If it does not, go back and keep looking for a stock until you find one that does.
The next component in this formula is to determine if on the previous day, in the last hour of trading, the stock closed above the 5 hour MA. If it has, move on to the next component in this killer formula. If not, reject the stock and start all over again until you find a stock that does.
The next component in this formula is to determine if the stock is at a 3 day high. If it is, move on to the next step below. If not, you know the drill, throw away this stock and start over again.
The next component in this formula is if the last price of the stock is above the 20 day MA. If it is, move on, if not, reject and start over.
The next component in this formula is if the stock has hit a 3 week high in the last week (the previous full week of trading). If not, reject the stock and start over.
The final component in this formula is if the stock has hit a 3 month high in the last month (the previous full month of trading).
What do you think about this strategy? Can we implement it in quantshare with daily values only?
All rules can be implemented except the second one (It requires intraday data)
Here is the strategy formula:
rule1 = sma(10) > sma(20) and sma(20) > sma(50);
// Cannot be implemented using daily data: In the last hour of trading, the stock closed above the 5 hour MA
rule3 = close == hhv(close, 3);
rule4 = close > sma(20);
rule5 = ref(TimeframeDecompress(TimeframeApply(7, close == hhv(close, 3))), 1);
rule6 = ref(TimeframeDecompress(TimeframeApply(31, close == hhv(close, 3))), 1);
buy = rule1 and rule3 and rule4 and rule5 and rule6;
My 2 cents... what would you use as sell criteria? Without the sell side of the equation, you don't yet have a full trading strategy.
I ran the formula provided for 2001 to current, and found the result to be -3.69% avg annual return, and a -0.89 sharpe ratio. So by itself, it doesn't seem promising. Perhaps with the missing rule and a different sell strategy... who knows.
But, that's the great thing about backtesting! Didn't cost anything to find that out. :)
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.