RSI and MA with Trailing Stop Loss and Take Profit (by Coinrule)The relative strength index is a momentum indicator used in technical analysis. It measures the speed and magnitude of a coin's recent price changes to evaluate overvalued or undervalued conditions in the price of that coin. The RSI is displayed as an oscillator (a line graph essentially) on a scale of zero to 100. When the RSI reaches oversold levels, it can provide a signal to go long. When the RSI reaches overbought levels, it can mark a good exit point or alternatively, an entry for a short position. Traditionally, an RSI reading of 70 or above indicates an overbought situation. A reading of 30 or below indicates an oversold condition.
A moving average (MA) calculates the average of a selected range of prices, usually closing prices, by the number of periods in that range. Essentially it is used to help smooth out price data by creating a constantly updated average price.
The Strategy enters and closes trades when the following conditions are met:
Entry Conditions:
RSI is greater than 50
MA9 is greater than MA50
RSI increases by 5
Exit Conditions:
Price increases by 1% trailing
Price decreases by 2% trailing
This strategy is back-tested from 1 January 2022 to simulate how the strategy would work in a bear market. The strategy provides good returns.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
Backtested
PIVOT STRATEGY [INDIAN MARKET TIMING]
A Back-tested Profitable Strategy for Free!!
A PIVOT INTRADAY STRATEGY for 5 minute Time-Frame , that also explains the time condition for Indian Markets
The Timing can be changed to fit other markets, scroll down to "TIME CONDITION" to know more.
The commission is also included in the strategy .
The basic idea is when ,
1) Price crosses above ema1 ,indicated by pivot highest line in green color .
2) Price crosses below ema1 ,indicated by pivot lowest line in red color .
3) Candle high crosses above pivot highest , is the Long condition .
4) Candle low crosses below pivot lowest , is the Short condition .
5) Maximum Risk per trade for the intraday trade can be changed .
6) Default_qty_size is set to 60 contracts , which can be changed under settings → properties → order size .
7) ATR is used for trailing after entry, as mentioned in the inputs below.
// ═════════════════════════//
// ————————> INPUTS <————————— //
// ═════════════════════════//
Leftbars —————> Length of pivot highs and lows
Rightbars —————> Length of pivot highs and lows
Price Cross Ema —————> Added condition
ATR LONG —————> ATR stoploss trail for Long positions
ATR SHORT —————> ATR stoploss trail for Short positions
RISK —————> Maximum Risk per trade for the day
The strategy was back-tested on RELIANCE ,the input values and the results are mentioned under "BACKTEST RESULTS" below .
// ═════════════════════════ //
// ————————> PROPERTIES<——————— //
// ═════════════════════════ //
Default_qty_size ————> 60 contracts , which can be changed under settings
↓
properties
↓
order size
// ═══════════════════════════════//
// ————————> TIME CONDITION <————————— //
// ═══════════════════════════════//
The time can be changed in the script , Add it → click on ' { } ' → Pine editor→ making it a copy [right top corner} → Edit the line 25 .
The Indian Markets open at 9:15am and closes at 3:30pm .
The 'time_cond' specifies the time at which Entries should happen .
"Close All" function closes all the trades at 3pm, at the open of the next candle.
To change the time to close all trades , Go to Pine Editor → Edit the line 103 .
All open trades get closed at 3pm , because some brokers don't allow you to place fresh intraday orders after 3pm .
NSE:RELIANCE
// ═══════════════════════════════════════════════ //
// ————————> BACKTEST RESULTS ( 128 CLOSED TRADES )<————————— //
// ═══════════════════════════════════════════════ //
INPUTS can be changed for better back-test results.
The strategy applied to NIFTY ( 5 min Time-Frame and contract size 60 ) gives us 60% profitability y , as shown below
It was tested for a period a 6 months with a Profit Factor of 1.45 ,net Profit of 21,500Rs profit .
Sharpe Ratio : 0.311
Sortino Ratio : 0.727
The graph has a Linear Curve with consistent profits .
The INPUTS are as follows,
1) Leftbars ————————> 3
2) Rightbars ————————> 5
3) Price Cross Ema ——————> 150
4) ATR LONG ————————> 2.7
5) ATR SHORT ———————> 2.9
6) RISK —————————> 2500
7) Default qty size ——————> 60
NSE:RELIANCE
Save it to favorites.
Apply it to your charts Now !!
↓
FOLLOW US FOR MORE !
Thank me later ;)
Consolidation Breakout [Indian Market Timing]OK let's get started ,
A Day Trading (Intraday) Consolidation Breakout Indication Strategy that explains time condition for Indian Markets .
The commission is also included in the strategy .
The basic idea is ,
1) Price crosses above upper band , indicated by a color change (green) is the Long condition .
2) Price crosses below lower band , indicated by a color change (red) is the Short condition .
3) ATR is used for trailing after entry
// ═══════════════════════════════//
// ————————> TIME CONDITION <————————— //
// ═══════════════════════════════//
The Indian Markets open at 9:15am and closes at 3:30pm.
The time_condition specifies the time at which Entries should happen .
"Close All" function closes all the trades at 2:57pm.
All open trades get closed at 2:57pm , because some brokers dont allow you to place fresh intraday orders after 3pm.
NSE:NIFTY1!
// ═══════════════════════════════════════════════ //
// ————————> BACKTEST RESULTS ( 114 CLOSED TRADES )<————————— //
// ═══════════════════════════════════════════════ //
LENGTH , MULT (factor) and ATR can be changed for better backtest results.
The strategy applied to NIFTY (3 min Time-Frame and contract size 5) gives us 60% profitability , as shown below
It was tested for a period a 8 months with a Profit Factor of 2.2 , avg Trade of 6000Rs profit and Sharpe Ratio : 0.67
The graph has a Linear Curve with consistent profits.
NSE:NIFTY1!
Save it favorites.
Apply it to your charts Now !!
Thank me later ;)
TradersAI_UTBotCREDITS to @HPotter for the orginal code.
CREDITS to @Yo_adriiiiaan for recently publishing the UT Bot study based on the original code -
I just added some simple code to turn it into a strategy. Now, anyone can simply add the strategy to their chart to see the backtesting results!
While @Yo_adriiiiaan mentions it works best on a 4-hour timeframe or above, I am happy to share that this seems to be working on a 15-minute chart on e-mini S&P 500 Index (using the KeyValue setting at 10)! You can play around with the different settings, and may be you might discover even better settings.
Hope this helps. Btw, if any of you play with different settings and discover great settings for a specific instrument, please share them with the community here - it will be rewarded back multiple times!