Indian NIFTY Correlation Daytrade/Swing StrategyINTRODUCTION :
This is a daytrading/swing strategy designed mainly for indian market where internally has been adapted to NIFTY market and as well using for internal calculations the values of the candles from NIFTY asset.
With it we search to use with the most correlated asset from the indian market.
For this example I choosed BANKNIFTY
STRATEGY:
The strategy initially uses as candle values the data from the NIFTY asset.
With them I am dividing the work into two calculation parts such as :
-For first part logic, I am doing calculations regarding the volatility of NIFTY, where I initially take into consideration INDIAVIX to have an idea of the expected implied volatility of NIFTY asset and then I compare it with different tools such as ATR, BB and Percentile location of the volatility.
Based on all these factors I take into account the location of the volatility which is atm and if there is a possibility of a strong movement(trend) or sidemarket situation.
-Once I am done with the values of the volatility, the next process in the script logic is to start looking into the trend.
For it I am using different tools such as volume checker, support and resistence key points, pivot points, price actions patterns and different moving averages.
-Risk management part : once we are done with calculation for the entry, the next part is to have an idea where to exit. In this case I am making use of a dynamic risk management which is compressed from multiple ideas such as : we can exit if there were a big gap on the next day in our initial direction, we can also exit based of an internal daily ATR calculation value(we use initially 15min timeframe chart) and lastly if we are around some key points like support/resistence or other different chart patterns like double top, double bot and so on.
CASE EXAMPLE:
As I said before we are initially using for calculation the NIFTY chart with 15min timeframe. With it we can apply to any indian etf,stocks,future. All the assets are going to have the same time of entry and the same time of exit(we get this from NIFTY) and we plot it on the chart we are using, so its key point to look for assets which have a min 75-80% correlation with NIFTY. For this example I used BANKNIFTY chart.
So a type of entry would be this way
Lets assume NIFTY50 is on 19.000 level
INDIAVIX level is currently at 11 which can be translated : 11 / sqrt(250)
So 11 means that on a yearly base we expect the asset to move 11% upwards or downwards
and in a year we have aprox 250 days. So we divide the 11 by sqrt of 250 to get an idea of a daily expected move from the implied volatility of india VIX
11/15.87 = +-0.69%
So INDIAVIX tells us that the values for today nifty is 19000+0,69% and 19000-0.69%
After that I am looking into the daily ATR, and I see that the expected is around 0.8% and is ascending over the last 2 weeks.
Lastly I am looking at the percentile which is currently the volatility on both ATR and INDIAVIX, and I get a value of 90th percentile.
With this my biased is that we are going to expect a short trend, but i cant confirm on the volatility alone so next step is start looking into technical analysis.
I look at volume and is increasing, I look at different price actions paterns and pivots and I see a lower low and a lower high (a descending pattern).
I also see the price is below the key MA like SMA50/100/200, VWAP and so on.
With all of this I get more confirmation that the asset is in a short trend.
Internally once a certain specific % of confirmation from all the logics is achieved, it will trigger a long/short entry, so in this case lets assume we have 80% of our indicators pointing to the short, is going to enter a short.
Now for a long scenario the scene would be , indiavix is around 9,5, ATR is descending. We are around 40th percentile of the volatility.
Our asset is above multiple moving averages, vwap , etc
We have an increasing volume towards bullish side.
And so on( overall 75% of our indicators are pointing towards the long side)
Now for the exit, since we are dealing with a daytrade/swing mentality, short on average we keep the trade open for a less period of time than long ( 19 bars of 15min candles, compared to 57 bars of 15min for long) , so most of the times for short we are going to exit next day and if the trend is still in our favour we re enter the trade.
For long we can stay much more time, sometimes even weeks and we exit mainly when the % of confirmation of indicators point out a reversal/short confirmation fo a big pice action pattern.
STRATEGY RESULTS
For strategy analysis I have used BANKNIFTY NSE with deep history to get access to data from 2011 until present( giving more than 2500 trades) .
For inputs I am using 0.02% comission total ( the comission applied from ZERODHA indian exchange is close to 0.0175% total) so I used it a bit higher in order to take into account some slippages.
For capital THE REASON I USED 100% of the capital allocation is to make a proper comparison with the buy an hold from the same period
Lets assume we had an account of 1M ruppes initially in 2011, we start using 100% of it and then the new values automatically compounded with the new profits and losses so directly compare with 1M of rupees in shares on BANKNIFTY ETFs bought in 2011(buy n hold) until present day.
STRATEGY ACCESS
Strategy is free to be tested for everyone, just let me know in private that you wish to get access to it.
Indian
Nifty 50 5mint Strategy
The script defines a specific trading session based on user inputs. This session is specified by a time range (e.g., "1000-1510") and selected days of the week (e.g., Monday to Friday). This session definition is crucial for trading only during specific times.
Lookback and Breakout Conditions:
The script uses a lookback period and the highest high and lowest low values to determine potential breakout points. The lookback period is user-defined (default is 10 periods).
The script also uses Bollinger Bands (BB) to identify potential breakout conditions. Users can enable or disable BB crossover conditions. BB consists of an upper and lower band, with the basis.
Additionally, the script uses Dema (Double Exponential Moving Average) and VWAP (Volume Weighted Average Price) . Users can enable or disable this condition.
Buy and Sell Conditions:
Buy conditions are met when the close price exceeds the highest high within the specified lookback period, Bollinger Bands conditions are satisfied, Dema-VWAP conditions are met, and the script is within the defined trading session.
Sell conditions are met when the close price falls below the lowest low within the lookback period, Bollinger Bands conditions are satisfied, Dema-VWAP conditions are met, and the script is within the defined trading session.
When either condition is met, it triggers a "long" or "short" position entry.
Trailing Stop Loss (TSL):
Users can choose between fixed points ( SL by points ) or trailing stop (Profit Trail).
For fixed points, users specify the number of points for the stop loss. A fixed stop loss is set at a certain distance from the entry price if a position is opened.
For Profit Trail, users can enable or disable this feature. If enabled, the script uses a "trail factor" (lookback period) to determine when to adjust the stop loss.
If the price moves in the direction of the trade and reaches a certain level (determined by the trail factor), the stop loss is adjusted, trailing behind the price to lock in profits.
If the close price falls below a certain level (lowest low within the trail factor(lookback)), and a position is open, the "long" position is closed (strategy.close("long")).
If the close price exceeds a certain level (highest high within the specified trail factor(lookback)), and a position is open, the "short" position is closed (strategy.close("short")).
Positions are also closed if they are open outside of the defined trading session.
Background Color:
The script changes the background color of the chart to indicate buy (green) and sell (red) signals, making it visually clear when the strategy conditions are met.
In summary, this script implements a breakout trading strategy with various customizable conditions, including Bollinger Bands, Dema-VWAP crossovers, and session-specific rules. It also includes options for setting stop losses and trailing stop losses to manage risk and lock in profits. The "trail factor" helps adjust trailing stops dynamically based on recent price movements. Positions are closed under certain conditions to manage risk and ensure compliance with the defined trading session.
CE=Buy, CE_SL=stoploss_buy, tCsl=Trailing Stop_buy.
PE=sell, PE_SL= stoploss_sell, tpsl=Trailing Stop_sell.
Remember that trading involves inherent risks, and past performance is not indicative of future results. Exercise caution, manage risk diligently, and consider the advice of financial experts when using this script or any trading strategy.
Trend Follower Intraday [ Adjustable TF ]Trend Follower Intraday for 3 minute Time-Frame (Adjustable) , that has the time condition for Indian Markets as well.
Unlike the Free Scripts - Risk Management , Position Sizing , Partial Exit etc. are also included .
Send us a Message to know more about the strategy.
// ══════════════════════════════════════════════════════════════════════════ //
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) EMA1 crosses above EMA2 , is a Long condition .
2) EMA1 crosses below EMA2 , is a Short condition .
3) Green Section indicates Long position.
4) Red Section indicates Short position.
5) Allowed hours specifies the trade entry timing.
6) ATR STOP is the stop-loss value on chart , can be adjusted in INPUTS.
7) Target 1 is the 1st target value on chart , can be adjusted in INPUTS.
8) RISK is Maximum Risk per trade for the intraday trade can be changed .
9) Total Capital used can be adjusted under INPUTS.
10) ATR TRAIL is used for trailing after entry, as mentioned in the inputs below.
11) Check trades under the list of trades .
12) Trade only in liquid stocks .
13) Risk only 1-5% of total capital.
14) Inputs can be changed for better back-test results, but also manually check the trades before setting alerts
15) SQUARE OFF TIME - As you change the time frame , also change the square-off time to the candle's closing time.
Eg: For 3min Time-frame , Hour = 2Hrs | Minute = 57min
16) Strategy stops for the day if you have a loss .
17) COMMISSION value is set to 20Rs and SLIPPAGE value is set to 2 . Go to properties to change it .
*The input values and the results are mentioned under "BACKTEST RESULTS" below*
// ══════════════════════════════ //
// ————————> RISK MANAGEMENT <——————— //
// ══════════════════════════════ //
Risk management is done based on max loss per trade and can be adjusted in the INPUTS.
// ═══════════════════════════ //
// ————————> POSITION SIZE <——————— //
// ═══════════════════════════ //
Quantity of each trade is different based on the loss
// ═════════════════════════ //
// ————————> PROPERTIES <——————— //
// ═════════════════════════ //
COMMISSION , SLIPPAGE ,RECALCULATE is already mentioned in the code.
COMMISSION can be charges , based on the broker charges.
// ═══════════════════════════════//
// ————————> TIME CONDITION <————————— //
// ═══════════════════════════════//
The time can be changed in the INPUT.
The Indian Markets open at 9:15am and closes at 3:30pm.
The 'Allowed hours' under Inputs specifies the time at which Entries should happen .
"Close All" function closes all the trades before 3pm , at the open of the next candle.
To change the time to close all trades , check INPUT.
All open trades get closed by 3pm , because some brokers don't allow you to place fresh intraday orders after 3pm .
// ═══════════════════════════════════════════════ //
// ————————> BACKTEST RESULTS ( 123 CLOSED TRADES ) <————————— //
// ═══════════════════════════════════════════════ //
INPUTS can be changed for better Back-Test results.
The strategy applied to NSE:JSWENERGY (3 min Time-Frame and with a capital of 3,00,000 ) gives us 81% profitability , as shown below
It was tested for a period a 6 months with a Profit Factor of 1.957 ,net Profit of 43,000Rs .
Sharpe Ratio = 0.745
Sortino Ratio = 2.091
No strategy in the world promises 100% profits in all market conditions , so always define your risk before trading.
Also check Back-Test results manually ,before setting Alerts
The Graph has a Linear Curve with Consistent Profits.
The INPUTS are as follows,
1) EMA1 ————————————————> 38
2) EMA2 ————————————————> 118
3) ALLOWED HRS ———————————> 9:35 TO 14:30
4) ATR STOP ——————————————> 3.2
5) RISK ——————————————————> 3000
6) ATR TRAIL ———————————————> 2.6
7) TARGET 1 ————————————————> 2.4
8) MAX POSITION VALUE ——————————> 3,00,000
8) MAX DRAWDOWN —————————————> 9,000
8) SQUARE-OFF ————————————————> 14:57
NSE:JSWENERGY
Apply it to your charts Now !
NSE:JSWENERGY
Send us a message for FREE TRIALS | Instant Access
Thank You ☺
SUPPORT RESISTANCE STRATEGY [5MIN TF]A SUPPORT RESISTANCE BREAKOUT STRATEGY for 5 minute Time-Frame , that has 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 Resistance Level ,indicated by Red Line, is a Long condition.
2) Price crosses below Support Level ,indicated by Green Line , is a Short condition.
3) Candle high crosses above ema1, is a part of the Long condition .
4) Candle low crosses below ema1, is a part of the Short condition .
5) Volume Threshold is an added confirmation for long/short positions.
6) Maximum Risk per trade for the intraday trade can be changed .
7) Default qty size is set to 50 contracts , which can be changed under settings → properties → order size.
8) ATR is used for trailing after entry, as mentioned in the inputs below.
// ═════════════════════════//
// ————————> INPUTS <————————— //
// ═════════════════════════//
→ L_Bars ———————————> Length of Resistance / Support Levels.
→ R_Bars ———————————> Length of Resistance / Support Levels.
→ Volume Break ———————> Volume Breakout from range to confirm Long/Short position.
→ Price Cross Ema —————> Added condition as explained above (3) and (4).
→ ATR LONG —————————> ATR stoploss trail for Long positions.
→ ATR SHORT ————————> ATR stoploss trail for Short positions.
→ RISK ————————————> Maximum Risk per trade intraday.
The strategy was back-tested on TCS ,the input values and the results are mentioned under "BACKTEST RESULTS" below.
// ═════════════════════════ //
// ————————> PROPERTIES<——————— //
// ═════════════════════════ //
Default_qty_size ————> 50 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 27.
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 92 .
All open trades get closed at 3pm , because some brokers don't allow you to place fresh intraday orders after 3pm .
// ═══════════════════════════════════════════════ //
// ————————> BACKTEST RESULTS ( 100 CLOSED TRADES )<————————— //
// ═══════════════════════════════════════════════ //
INPUTS can be changed for better Back-Test results.
The strategy applied to NSE:TCS ( 5 min Time-Frame and contract size 50) gives us 60% profitability , as shown below
It was tested for a period a 6 months with a Profit Factor of 1.8 ,net Profit of 30,000 Rs profit .
Sharpe Ratio : 0.49
Sortino Ratio : 1.4
The graph has a Linear Curve with Consistent Profits.
The INPUTS are as follows,
1) L_Bars —————————> 4
2) R_Bars —————————> 4
3) Volume Break ————> 5
4) Price Cross Ema ——> 100
5) ATR LONG ——————> 2.4
6) ATR SHORT —————> 2.6
7) RISK —————————> 2000
8) Default qty size ——> 50
NSE:TCS
Save it to favorites.
Apply it to your charts Now !!
Thank You ☺ NSE:TCS
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 ;)
Сatching knivesThis strategy is based on the regression line and volume
The Linear Regression Channel is a three-line technical indicator that displays the high, low and midpoint of the current trend.
How does it work in strategy?
If there is a deviation by a given percentage, the entry occurs
//LOGIC ENTRY
-Length-сhannel length
-Deviation-deviation of the boundaries, the higher , the rarer the entries
-% low for regression-deviation directly from the boundaries, the higher the number, the less frequent the entries
-Required % down bar-additional condition for entry (the candle on which the entry takes place from the logic must necessarily fall by a given percentage)
-Volume-the volume, which must be larger by the number of times you specify ( you can set the volume lower, but for better entries, you need to set the deviation percentages higher!)
//EXIT SETTING
Take profit and stop loss when a certain percentage is reached
//SETTINGS NEXT ENTRY AND GRID
Allow signal lower than,% - the next entry into a trade from logic occurs only when a decrease by a certain percentage
Allow grid,% - when the price drops by the percentage specified in the settings, the entry will take place, but only on the next bar.
//DATA RANGE
-Testing results for any period of time
//
Default settings for infrequent but relatively accurate entries for TF 1 hour.
It costs pyramiding 5 and take profit 5%. Choose the flavors of your choice!
Good luck!
Double top/bottomHello!
This alerts is based on the double bottom pattern - for entering a long position / double top-short
A double bottom pattern is formed when two price bottoms are relatively at the same level and the top acts as resistance. This pattern appears at the end of a downtrend and signals a reversal.
A double top is a bearish reversal pattern that signals the end of an uptrend. It is formed by two price highs forming at the same level and a notch line that acts as local support.
As history and practice show, the double bottom pattern works better. Moreover, in a bull market.
// LOGIC ENTRY:
Period for short and long positions-to search for double bottom as well as double top . the more, the less false.
Change liong and short-channel width for pattern search separately for long and short.
General shift-the overall width of the channel, which changes equally at once for long and short
By default, quiet settings for 1 hour
You can choose the settings you like.
//FILTER SETTING
-RSI
If the checkbox is checked, the filter will be enabled.
The higher the upper bound, the less frequent short entries.
The lower the indicators of the lower border, the less frequent entries to the long
Go_up Hello. Our task is to find the local minimum. The trade is entered on the basis of RSI and SMA according to a specific formula, which is embedded in the code. When the RSI crosses the SMA upside down, a long position is entered. You can change the length of the RSI. The longer the length, the less frequent, but more accurate the entrance, and vice versa. You can use a different time frame. The default RSI length is 25 and the time frame is 15 minutes. Use hooks for auto trading, there is an alert. I recommend using a larger number of altcoins and with the default settings or TF 5 minutes. If you want to "scalp", then use the length 15-21 and take profit 0.5-2 percent. See the history of signals and you can make the optimal strategy for yourself. Due to the strong volatility, these settings are optimal. I use position averaging over history, additional purchase occurs no more than three times, before going into a plus. Entering a trade in notifications "once per bar". To exit, you can use scripts from other authors, for example, pivot / resistance points. No repainting. If anyone has any questions, write, I will answer in detail. good luck trading, dear friends!