I need a simple follow trend strategy pine script version 3 code created that:
- determines the current trend based on 10 candles before the current candle.
- Triggers a sell trade in a downtrend market, when:
- the market moves up for max 5 candles and then returns to falling
- the value of the initial candle (trigger candle) is the sell point
- the max heigh of the 5 candles is set as Stop Lose (SL)
- set the Take Profit (TP) to (distance between trigger candle value + Stop Lose) * 2
- place a red downarrow above the trigger candle with the value where the purchase was taken
- Same for rising markets where it sets a buy trade
- SL and TP calculation works the other way around as for the sell market. Red colors are replaced by green and above text positions are replaced by below positions
- Option to activate tailing stop lose (TSL)
See enclosed charts with definitions for further description. Let me know if you have questions.
Script is for: [login to view URL]
More changes in the code to improve the strategy will probably follow.