OPEN-SOURCE SCRIPT
Updated HL MovingAvg2Line Cross Dhananjay

Sharing the simple trend following trading strategy, traders can add their own rules in this, to minimise the losses and maximise the profits. Like below.
1. Go long only if price is above 189 days EMA/SAM
2. Exit position when high or low of previous candle is breached in the opposite direction of the trend.
3. Go long only if price is in up trend on higher time frame charts and go short when price is down trend of higher time frame charts.
Stop loss, target and other things can also be decided by the trader.
Idea is to capture the short term trend to trade in FnO or 2/3 days position in underlying instrument.
Traders can optimise the length of the Moving average so that your traded is set for maximum profit giving settings for this strategy. Different instruments responds to different moving averages because of different volatility.
Idea is to go long when price closes above 9 days EMA of Highs and exit and go short whenever price closes below 9 days EMA of lows, exit short when first condition meets after short trade.
I ma not that good with scripts, have many such ideas, interested script writers can get in touch with me so that we can create trading systems which have grater success rate.
Release Notes
In the earlier script the input option was not given in the updates version Input option is added.Now traders can change the EMA setting to maximize the profit. Different instrument respond to different EMAs.
Release Notes
Have changed the quantity to 0 , you can change it from properties. Change MA length to maximize profits. Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.