Algo trade is one wonderful thing, but we cannot do better if just know it's advantage. Some demo algo is look very good, but just change test time period or test stock, the result is very different. So, i try to develop the algo that can be sustained and stable profit. Trade idea is first, programing skill is second. Let us begin from basic step by step.
1.trend follow strategy
2.anti-trend follow strategy
3.technical indicator based strategy
4.history statistics data strategy
5.momentum strategy
1.trend follow strategy
The trend follow stratgy, that principle is rising stocks will rise higher. "The trend is your friend, follow them". How to find a up trend? Here are some known ways:
1.1 current price is above moving average
1.2 current price is above bollinger upper line
1.3 reach a higher price than history data
1.1 moving average
Buy order if the current price is above moving average. Sell order if the current price is below moving average.
code demo 1.1