OPEN-SOURCE SCRIPT
Granny Strategy [rdjxyz]

This is the Granny Strategy, as described on TG Capital's Sunday Service stream.
Definitions
The Setup
*As described on the stream.
*Look for longs when price is above 50 EMA; look for shorts when price is below the 50 EMA.
Inputs
Exception Inputs
Allow some exceptions to the rigid rules
Play around with the different settings on various timeframes and instruments to find rules that work best for your strategy goals. Or just use it to find valid vs. invalid setups historically.
Will be working on adding a trailing stop loss.
Leave a comment with any bugs or ideas you have to improve the strategy.
IMPORTANT
Adjust account size, position size, commissions, etc in the properties tab for accurate results!
Definitions
- C0 - Candle 0 - the candle where the FVG start is plotted
- C1 - Candle 1 - the candle that drives the FVG
- C2 - Candle 2 - the candle where the FVG end is plotted
- C3 - Candle 3 - the entry candle (assuming all criteria are met)
- 👵🏻 - Valid setup
- 🤡 - Invalid setup
The Setup
*As described on the stream.
*Look for longs when price is above 50 EMA; look for shorts when price is below the 50 EMA.
- FVG is printed
- C2 sweeps the low of C1 and closes bullish (for longs) or sweeps the high of C1 and closes bearish (for shorts)
- C3 inverts FVG and closes below C1 open (for longs) or above C1 open (for shorts)
- If criteria above is met, position is entered on the close of C3 with stop loss at the low of C3 (for longs) or high of C3 (for shorts)
Inputs
- Time Window Filter - only look for setups within a certain range of time
- EMA length - original strategy calls for 50
- Stop loss offset - ticks to offset stop loss from low (for longs) / high (for shorts) of C3
- Risk:Reward ratio - take profit as a multiple of the stop loss size from entry
- Break even stop loss - optional, move stop loss to break even after price reaches a specific R:R; e.g. once price hits 1:1 R:R, move stop loss to break even
Exception Inputs
Allow some exceptions to the rigid rules
- Select which candle in the sequence the EMA filter is applied to (can produce different results)
- Disable EMA bias filter (will find shorts when price is above EMA and longs when price is below)
- Allow C3 to close inside of FVG (instead of completely inverting it)
- Allow C3 to close above C1 open (for longs) or below C1 open (for shorts)
- Allow C2 to close opposite of setup direction; e.g. if long, C2 is allowed to close as a bearish candle instead of bullish candle
Play around with the different settings on various timeframes and instruments to find rules that work best for your strategy goals. Or just use it to find valid vs. invalid setups historically.
Will be working on adding a trailing stop loss.
Leave a comment with any bugs or ideas you have to improve the strategy.
IMPORTANT
Adjust account size, position size, commissions, etc in the properties tab for accurate results!
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。