This strategy is designed to use the RSI and EMA filters. A 200 period EMA is used for short / long filters, and the 50 period EMA is used to determine the direction of the short term trend.
In addition, the script uses "rate of change" for the fast EMA (trend), volume , RSI (momentum), and price (volatility) and only takes trades when all are in optimal conditions.
I.E., the EMA is in an uptrend, the volume is increasing, price is in an uptrend, and the RSI is in an uptrend, so we will place a Long trade.
This strategy uses EMAs as a trailing stop loss and take profit. As this is a trend following strategy, the idea is to maximize profits when correct and minimize losses when
wrong.
It was designed specifically using crypto pairs, and was optimized for the 10 minute chart.
My goal was to get the best use out of the RSI indicator. I was originally an MACD fanboy, but have recently converted.
Want to help me improve this code or strategy? Have suggestions for improvement? Leave them in the comments below.
Thanks for using my script! I hope it works well for you and good luck in the markets.
If you have any questions, please leave them in the comments and I'll do my best to respond.
This script does not repaint as it only relies on close data to make a decision to enter a trade.
How to use this strategy:
___________________________
Enable Long Entries? - Used to enable or disable the strategy from executing long entries.
Enable Short Entries? - Used to enable or disable the strategy from executing short entries.
How Many Bars To Look Back for Hi/Lo: - This is used for the Stop Loss and Take Profit targets. An integer of bars is used to look back and calculate the values.
RSI Length (Rec: 8) - The length of the RSI
Source - The RSI Source
Use Slow EMA? - If checked, a 200 period EMA will be used to filter entries long or short (only take shorts when the price is below, long when above). In addition, the script will close any trades that cross the 200 period EMA. By default this is disabled.
EMA Slow - the period of the Slow EMA (200 by default)
EMA Slow Src - what to use to calculate the Slow EMA (high by default)
EMA Fast - The Fast EMA (50 period) is used to calculate the direction of the short term trend. This also factored into the Rates of Change.
EMA Fast Src - what to use to calculate the Fast EMA
ATR Length - If used, the ATR length is used to calculate the Stop Loss and Take Profit targets.
SL Multiplier - The distance away from the initial value to multiply the Stop Loss
TP Multiplier - The distance away from the initial value to multiply the Take Profit.
Use EMA as SL / TP? - If true (default) a 3 period EMA is used to calculate Stop Loss and Take Profit targets. Else, an ATR is used to calculate these values.
Stop Loss / Take Profit Offset - Default: 3 - this is used to shift the EMA / ATR Stop Loss and Take Profit lines to the right X bars. This is to ensure that they are hit properly and not exceeded.
Short Len Vol - Use to calculate the volume of the short length, used in rate of change calculations
Long Len - Use to calculate the volume of the long length, used in rate of change calculations
RSI Long Entry Val - Minimum RSI crossover value to enter a trade Long. If the RSI is below this value, trade entries are not valid.
RSI Long Cutoff Threshold - Long entry RSI value cutoff to no longer enter trades. If the RSI is above this value, trades entries are not valid.
RSI Short Entry Val - Minimum RSI crossover value to enter a trade Short. If the RSI is above this value, trade entries are not valid.
RSI Short Cutoff Threshold - Short entry RSI value cutoff to no longer enter trades. If the RSI is below this value, trades entries are not valid.
ROC Fast EMA - Calculates the rate of change between the Fast Ema now and 'X' bars ago. \n\n For a long entry, a positive value is needed, and for a short entry, a negative value is needed.
ROC Price - Calculates the rate of change between the most recent price close and 'X' bars ago. \n\n For a long entry, a positive value is needed, and for a short entry, a negative value is needed.
ROC RSI - Calculates the rate of change between the RSI now and 'X' bars ago. \n\n For a long entry, a positive value is needed, and for a short entry, a negative value is needed.
Use Close for SL - Default = Off - If checked, when a candle hits the stop loss, the trade will close on the next candle. If unchecked, the trade will remain open until the candle closes at or beyond the stop loss lines.
Custom Message Boxes - Primarily used for bots, but can be used to also insert your own messages for your trading alerts.