Nifty - Gap up Screener
Sample Stock Screener NSE is used to identify the list of Gap up Stocks from provided list. Modify script for other conditions
original credits: achalmeena ( )
Educational
Intraday Buy/Sell using Gann Angles - RiTzIntraday Buy/Sell Levels using Gann Angles based on Todays Open/previous Day High/Low/Close prices
How to use this :
The Buy/Sell levels will be calculated on 1 of 4 things (you can choose any one which you prefer)
1. Todays Open price
2. Previous Day High
3. Previous Day Low
4. Previous Day Close
The Buy/Sell levels will be displayed in these ways
1. In a Table
2. on the Chart
You can turn them on/off according to your preference!
I can't seem to find the original documentation or a link to it.
i have it's excel file, in which we have to enter following data :
1. Todays Open price
2. Previous Day High
3. Previous Day Low
4. Previous Day Close
and the buy/sell levels are calculated by using the above data in following manner :
Based On Today's Opening Price
(lets call it TDO)
Degree's````````````````` Degree Factor```````````````````````` Buy````````````````````````` Sell
11.25```````````````````` =degree/180=11.25/180=0.0625````````` =(sqrt(TDO)-0.0625)^2``````` =(sqrt(TDO)+0.0625)^2````` SL
22.5````````````````````` =degree/180=22.5/180=0.125``````````` =(sqrt(TDO)+0.125)^2```````` =(sqrt(TDO)-0.125)^2`````` Buy/Sell At
45``````````````````````` =degree/180=45/180=0.25`````````````` =(sqrt(TDO)+0.25)^2````````` =(sqrt(TDO)-0.25)^2``````` Target-1
90``````````````````````` =degree/180=90/180=0.5``````````````` =(sqrt(TDO)+0.5)^2`````````` =(sqrt(TDO)-0.5)^2```````` Target-2
135`````````````````````` =degree/180=135/180=0.75````````````` =(sqrt(TDO)+0.75)^2````````` =(sqrt(TDO)-0.75)^2``````` Target-3
180`````````````````````` =degree/180=180/180=1```````````````` =(sqrt(TDO)+1)^2```````````` =(sqrt(TDO)-1)^2`````````` Target-4
225`````````````````````` =degree/180=225/180=1.25````````````` =(sqrt(TDO)+1.25)^2````````` =(sqrt(TDO)-1.25)^2``````` Target-5
270`````````````````````` =degree/180=270/180=1.5`````````````` =(sqrt(TDO)+1.5)^2`````````` =(sqrt(TDO)-1.5)^2```````` Target-6
315`````````````````````` =degree/180=315/180=1.75````````````` =(sqrt(TDO)+1.75)^2````````` =(sqrt(TDO)-1.75)^2``````` Target-7
360`````````````````````` =degree/180=360/180=2```````````````` =(sqrt(TDO)+2)^2```````````` =(sqrt(TDO)-2)^2`````````` Target-8
sqrt = square root
TDO = Today's Opening Price
PDH = Previous Days High
PDL = Previous Days Low
PDC = Previous Days Close
Based On Previous Days High Price
(lets call it PDH)
Degree's````````````````` Degree Factor```````````````````````` Buy````````````````````````` Sell
11.25```````````````````` =degree/180=11.25/180=0.0625````````` =(sqrt(PDH)-0.0625)^2``````` =(sqrt(PDH)+0.0625)^2````` SL
22.5````````````````````` =degree/180=22.5/180=0.125``````````` =(sqrt(PDH)+0.125)^2```````` =(sqrt(PDH)-0.125)^2`````` Buy/Sell At
45``````````````````````` =degree/180=45/180=0.25`````````````` =(sqrt(PDH)+0.25)^2````````` =(sqrt(PDH)-0.25)^2``````` Target-1
90``````````````````````` =degree/180=90/180=0.5``````````````` =(sqrt(PDH)+0.5)^2`````````` =(sqrt(PDH)-0.5)^2```````` Target-2
135`````````````````````` =degree/180=135/180=0.75````````````` =(sqrt(PDH)+0.75)^2````````` =(sqrt(PDH)-0.75)^2``````` Target-3
180`````````````````````` =degree/180=180/180=1```````````````` =(sqrt(PDH)+1)^2```````````` =(sqrt(PDH)-1)^2`````````` Target-4
225`````````````````````` =degree/180=225/180=1.25````````````` =(sqrt(PDH)+1.25)^2````````` =(sqrt(PDH)-1.25)^2``````` Target-5
270`````````````````````` =degree/180=270/180=1.5`````````````` =(sqrt(PDH)+1.5)^2`````````` =(sqrt(PDH)-1.5)^2```````` Target-6
315`````````````````````` =degree/180=315/180=1.75````````````` =(sqrt(PDH)+1.75)^2````````` =(sqrt(PDH)-1.75)^2``````` Target-7
360`````````````````````` =degree/180=360/180=2```````````````` =(sqrt(PDH)+2)^2```````````` =(sqrt(PDH)-2)^2`````````` Target-8
Based On Previous Days Low Price
(lets call it PDL)
Degree's````````````````` Degree Factor```````````````````````` Buy````````````````````````` Sell
11.25```````````````````` =degree/180=11.25/180=0.0625````````` =(sqrt(PDL)-0.0625)^2``````` =(sqrt(PDL)+0.0625)^2````` SL
22.5````````````````````` =degree/180=22.5/180=0.125``````````` =(sqrt(PDL)+0.125)^2```````` =(sqrt(PDL)-0.125)^2`````` Buy/Sell At
45``````````````````````` =degree/180=45/180=0.25`````````````` =(sqrt(PDL)+0.25)^2````````` =(sqrt(PDL)-0.25)^2``````` Target-1
90``````````````````````` =degree/180=90/180=0.5``````````````` =(sqrt(PDL)+0.5)^2`````````` =(sqrt(PDL)-0.5)^2```````` Target-2
135`````````````````````` =degree/180=135/180=0.75````````````` =(sqrt(PDL)+0.75)^2````````` =(sqrt(PDL)-0.75)^2``````` Target-3
180`````````````````````` =degree/180=180/180=1```````````````` =(sqrt(PDL)+1)^2```````````` =(sqrt(PDL)-1)^2`````````` Target-4
225`````````````````````` =degree/180=225/180=1.25````````````` =(sqrt(PDL)+1.25)^2````````` =(sqrt(PDL)-1.25)^2``````` Target-5
270`````````````````````` =degree/180=270/180=1.5`````````````` =(sqrt(PDL)+1.5)^2`````````` =(sqrt(PDL)-1.5)^2```````` Target-6
315`````````````````````` =degree/180=315/180=1.75````````````` =(sqrt(PDL)+1.75)^2````````` =(sqrt(PDL)-1.75)^2``````` Target-7
360`````````````````````` =degree/180=360/180=2```````````````` =(sqrt(PDL)+2)^2```````````` =(sqrt(PDL)-2)^2`````````` Target-8
Based On Previous Days Close Price
(lets call it PDC)
Degree's````````````````` Degree Factor```````````````````````` Buy````````````````````````` Sell
11.25```````````````````` =degree/180=11.25/180=0.0625````````` =(sqrt(PDC)-0.0625)^2``````` =(sqrt(PDC)+0.0625)^2````` SL
22.5````````````````````` =degree/180=22.5/180=0.125``````````` =(sqrt(PDC)+0.125)^2```````` =(sqrt(PDC)-0.125)^2`````` Buy/Sell At
45``````````````````````` =degree/180=45/180=0.25`````````````` =(sqrt(PDC)+0.25)^2````````` =(sqrt(PDC)-0.25)^2``````` Target-1
90``````````````````````` =degree/180=90/180=0.5``````````````` =(sqrt(PDC)+0.5)^2`````````` =(sqrt(PDC)-0.5)^2```````` Target-2
135`````````````````````` =degree/180=135/180=0.75````````````` =(sqrt(PDC)+0.75)^2````````` =(sqrt(PDC)-0.75)^2``````` Target-3
180`````````````````````` =degree/180=180/180=1```````````````` =(sqrt(PDC)+1)^2```````````` =(sqrt(PDC)-1)^2`````````` Target-4
225`````````````````````` =degree/180=225/180=1.25````````````` =(sqrt(PDC)+1.25)^2````````` =(sqrt(PDC)-1.25)^2``````` Target-5
270`````````````````````` =degree/180=270/180=1.5`````````````` =(sqrt(PDC)+1.5)^2`````````` =(sqrt(PDC)-1.5)^2```````` Target-6
315`````````````````````` =degree/180=315/180=1.75````````````` =(sqrt(PDC)+1.75)^2````````` =(sqrt(PDC)-1.75)^2``````` Target-7
360`````````````````````` =degree/180=360/180=2```````````````` =(sqrt(PDC)+2)^2```````````` =(sqrt(PDC)-2)^2`````````` Target-8
example based On Today's Opening Price = 4339
Degree's```````` Degree Factor```````` Buy`````````` Sell
11.25``````````` 0.0625``````````````` 4330.77`````` 4347.24```````` SL
22.5```````````` 0.125```````````````` 4355.48`````` 4322.55```````` Buy/Sell At
45`````````````` 0.25````````````````` 4372.00`````` 4306.13```````` Target-1
90`````````````` 0.5`````````````````` 4405.12`````` 4273.38```````` Target-2
135````````````` 0.75````````````````` 4438.37`````` 4240.76```````` Target-3
180````````````` 1```````````````````` 4471.74`````` 4208.26```````` Target-4
225````````````` 1.25````````````````` 4505.24`````` 4175.88```````` Target-5
270````````````` 1.5`````````````````` 4538.86`````` 4143.64```````` Target-6
315````````````` 1.75````````````````` 4572.61`````` 4111.51```````` Target-7
360````````````` 2```````````````````` 4606.48`````` 4079.52```````` Target-8
Note : ignore the '`' , inserted them to fill up the spaces , it was looking very weird!, tried to fix it as much as I can.
Note :- Please correct me if I'm wrong , as I've already mentioned I don't have it's original documentation.
if anyone can find it or already has it then please feel free to share it.
VIDYA Trend StrategyOne of the most common messages I get is people reaching out asking for quantitative strategies that trade cryptocurrency. This has compelled me to write this script and article, to help provide a quantitative/technical perspective on why I believe most strategies people write for crypto fail catastrophically, and how one might build measures within their strategies that help reduce the risk of that happening. For those that don't trade crypto, know that these approaches are applicable to any market.
I will start off by qualifying up that I mainly trade stocks and ETFs, and I believe that if you trade crypto, you should only be playing with money you are okay with losing. Most published crypto strategies I have seen "work" when the market is going up, and fail catastrophically when it is not. There are far more people trying to sell you a strategy than there are people providing 5-10+ year backtest results on their strategies, with slippage and commissions included, showing how they generated alpha and beat buy/hold. I understand that this community has some really talented people that can create some really awesome things, but I am saying that the vast majority of what you find on the internet will not be strategies that create alpha over the long term.
So, why do so many of these strategies fail?
There is an assumption many people make that cryptocurrency will act just like stocks and ETFs, and it does not. ETF returns have more of a Gaussian probability distribution. Because of this, ETFs have a short term mean reverting behavior that can be capitalized on consistently. Many technical indicators are built to take advantage of this on the equities market. Many people apply them to crypto. Many of those people are drawn down 60-70% right now while there are mean reversion strategies up YTD on equities, even though the equities market is down. Crypto has many more "tail events" that occur 3-4+ standard deviations from the mean.
There is a correlation in many equities and ETF markets for how long an asset continues to do well when it is currently doing well. This is known as momentum, and that correlation and time-horizon is different for different assets. Many technical indicators are built based on this behavior, and then people apply them to cryptocurrency with little risk management assuming they behave the same and and on the same time horizon, without pulling in the statistics to verify if that is actually the case. They do not.
People do not take into account the brokerage commissions and slippage. Brokerage commissions are particularly high with cryptocurrency. The irony here isn't lost to me. When you factor in trading costs, it blows up most short-term trading strategies that might otherwise look profitable.
There is an assumption that it will "always come back" and that you "HODL" through the crash and "buy more." This is why Three Arrows Capital, a $10 billion dollar crypto hedge fund is now in bankruptcy, and no one can find the owners. This is also why many that trade crypto are drawn down 60-70% right now. There are bad risk practices in place, like thinking the martingale gambling strategy is the same as dollar cost averaging while also using those terms interchangeably. They are not the same. The 1st will blow up your trade account, and the 2nd will reduce timing risk. Many people are systematically blowing up their trade accounts/strategies by using martingale and calling it dollar cost averaging. The more risk you are exposing yourself too, the more important your risk management strategy is.
There is an odd assumption some have that you can buy anything and win with technical/quantitative analysis. Technical analysis does not tell you what you should buy, it just tells you when. If you are running a strategy that is going long on an asset that lost 80% of its value in the last year, then your strategy is probably down. That same strategy might be up on a different asset. One might consider a different methodology on choosing assets to trade.
Lastly, most strategies are over-fit, or curve-fit. The more complicated and more parameters/settings you have in your model, the more likely it is just fit to historical data and will not perform similar in live trading. This is one of the reasons why I like simple models with few parameters. They are less likely to be over-fit to historical data. If the strategy only works with 1 set of parameters, and there isn't a range of parameters around it that create alpha, then your strategy is over-fit and is probably not suitable for live trading.
So, what can I do about all of this!?
I created the VIDYA Trend Strategy to provide an example of how one might create a basic model with a basic risk management strategy that might generate long term alpha on a volatile asset, like cryptocurrency. This is one (of many) risk management strategies that can reduce the volatility of your returns when trading any asset. I chose the Variable Index Dynamic Average (VIDYA) for this example because it's calculation filters out some market noise by taking into account the volatility of the underlying asset. I chose a trend following strategy because regressions are capturing behaviors that are not just specific to the equities market.
The more volatile an asset, the more you have to back-off the short term price movement to effectively trend-follow it. Otherwise, you are constantly buying into short term trends that don't represent the trend of the asset, then they reverse and loose money. This is why I am applying a trend following strategy to a 4 hour chart and not a 4 minute chart. It is also important to note that following these long term trends on a volatile asset exposes you to additional risk. So, how might one mitigate some of that risk?
One of the ways of reducing timing risk is scaling into a trade. This is different from "doubling down" or "trippling down." It is really a basic application of dollar cost averaging to reduce timing risk, although DCA would typically happen over a longer time period. If it is really a trend you are following, it will probably still be a trend tomorrow. Trend following strategies have lower win rates because the beginning of a trend often reverses. The more volatile the asset, the more likely that is to happen. However, we can reduce risk of buying into a reversal by slowly scaling into the trend with a small % of equity per trade.
Our example "VIDYA Trend Strategy" executes this by looking at a medium-term, volatility adjusted trend on a 4 hour chart. The script scales into it with 4% of the account equity every 4-hours that the trend is still up. This means you become fully invested after 25 trades/bars. It also means that early in the trade, when you might be more likely to experience a reversal, most of your account equity is not invested and those losses are much smaller. The script sells 100% of the position when it detects a trend reversal. The slower you scale into a trade, the less volatile your equity curve will be. This model also includes slippage and commissions that you can adjust under the "settings" menu.
This fundamental concept of reducing timing risk by scaling into a trade can be applied to any market.
Disclaimer: This is not financial advice. Open-source scripts I publish in the community are largely meant to spark ideas that can be used as building blocks for part of a more robust trade management strategy. If you would like to implement a version of any script, I would recommend making significant additions/modifications to the strategy & risk management functions. If you don’t know how to program in Pine, then hire a Pine-coder. We can help!
Future Risk CalculatorCreated out of revenge against the difficulty of controlling psychology, greed, and risk management. Designed for cryptocurrency futures trading by following the risk management principles from Kevin Sailly. Very welcome if there are suggestions and input to improve the quality of this "indicator". Please use wisely.
How to use:
1. Open indicator settings.
2. Fill out all the forms. (Note: I make Max Loss Risk only has 5 options. Because, you know, to control the greed. You can choose by considering your risk profiles and market condition)
3. All of the information and calculation will appear on the label (right side of the bar chart) and top-right box.
4. You can adjust the three prices (target, entry, and stop) by clicking any part of the indicator. There will be three dots in the middle of the chart window (align with three prices). Click that dots and drag them up/down to customize according to your wishes. The price order must be correct, for LONG direction the price order from the top is target-entry-stop. Vice versa for SHORT direction. There will be "SETUP ERROR" text in the top-right box if the price order is not correct.
"Never, ever argue with your trading system." (by Michael Covel)
Regards,
Ircham
Fed Net Liquidity IndicatorThis indicator aims to present a "Net Liquidity" indicator comprised of the Fed Balance sheet , less the TGA account and Overnight Reverse REPO agreements.
Net Liquidity = Fed Balance Sheet - ( TGA + Reverse REPO)
This is an overlay that can be added to stock or other charts (like SPY ) to see how the market may appear correlated to Net Liquidity - injection of liquidity into the markets.
This was hypothesized by Max Anderson, this is just a script realizing that posting.
New updates include a resolution feature, and an option to offset backwards by 2 days per original intent.
Relative Andean ScalpingThis is an experimental signal providing script for scalper that uses 2 of open source indicators.
First one provides the signals for us called Andean Oscillator by @alexgrover . We use it to create long signals when bull line crosses over signal line while being above the bear line. And reverse is true for shorts where bear line crosses over signal line while being above bull line.
Second one is used for filtering out low volatility areas thanks to great idea by @HeWhoMustNotBeNamed called Relative Bandwidth Filter . We use it to filter out signals and create signals only when the Relative Bandwith Line below middle line.
The default values for both indicators changed a bit, especially used linreg values to create relatively better signals. These can be changed in settings. Please be aware that i did not do extensive testing with this indicator in different market conditions so it should be used with caution.
Timed AlertTradingView doesn't offer a way easily set timed alerts. This script solves that problem and also allows you to set variables in the script similar to other alerts.
The variables can be found here .
Manual Stop Loss / Risk Management PanelHere is a panel where you enter the desired stop-loss price, the amount you would like to risk and it spits out what you should trade to only lose that amount if the stop-loss is hit.
Midpoint - MGEnglish Descriptions
Midpoint - MG indicator is an indicator available in Netdania application. I wanted to contribute of moving it to this environment for Tradingview users. The basic logic is the value obtained by adding the highest and lowest levels in the specified periods and dividing them into two. The specified range is left to user preference. The desired range can be selected from the indicator settings. The intersection of the price with this average up or down can be used as an auxiliary element related to our trade. Thanks in the hope that it will be useful.
Türkçe Açıklama
Midpoint - MG indikatörü Netdania uygulamasında bulunan bir göstergedir. Bende Tradingview kullanıcıları için bu ortama taşıyarak katkıda bulunmak istedim. Temel mantığı belirlenen periyotlarda en yüksek ve en düşük seviyenin toplanarak ikiye bölünmesiyle ortaya çıkan değerdir. Belirlenen aralık kullanıcı tercihine bırakılmıştır. İndikatör ayarlarından istenen aralık seçilebilmektedir. Fiyatın bu ortalama ile aşağı veya yukarı kesişmesi bize ticaretimiz ile alakalı yardımcı unsur olarak kullanılabilmektedir. Faydalı olması umuduyla teşekkkürler.
SessionsA very simple indicator that draws vertical lines on the chart to visually indicate session boundaries. You can set any target timeframe that is larger than the current one and is a multiple of it.
--
Очень простой индикатор, который строит вертикальные линии на графике, чтобы визуально указать границы сессий. Можно задавать любой целевой таймфрейм, который больше текущего и кратен ему.
Current price & Daily openFor those who likes clean chart:
I made a simple script that shows Current price based on the last candle color.
Also can show Daily open line based on the daily candle color.
Daily open line is same as strong support and resistance levels.
Mostly price shows strong responces on daily open line.
1: Daily open line color is blue if current price is above the daily open line.
And daily open line is red if current price is below the daily open line.
This means blue daily open line represents bullish daily candle and red daily open line represents bearish daily candle.
Simply you can expect Buy setup on the daily open line if it is blue and vice versa. That means you are following the daily trend, nothing else.
Always double confirm with your own trading style. It's not guaranteed.
You can use this script when you want to see daily price action or to find daily high lows.
This script helps to identify the following day high and lows too on the lower timeframe.
2: When you add drawing tools on your chart price labels are overlapping or if you choose not overlap then price moves up or down so you are not able to see current price easily.
This script helps to show current price on the last candle. You can easily see the current price.
Current price color is blue when last candle is bullish and it's red when last candle is bearish .
It always calculates last candle. So it could be weekly or 1 minute candle, whatever timeframe you working on.
Thank you.
Session High Low
This indicator shows Session High Low line and prices.
1: Session range is adjustable based on your timeframe. Nomore confusing timezone settings.
You can choose your timezone then set your Session start and end time.
Script will show you the following session high and low lines which is extendable until next session.
2: All historical lines and price levels are can be partially or fully hidden.
And line colors are adjustable so you can use suitable color on your chart.
Based on session you choose this script can be used as a session break strategy AKA (Asian session break, London session break strategy).
You can create your own trading Session and high lows.
Personally I monitor how price reacts on London session high lows during the NewYork trading session.
In this chart Session starts at 8am (London open) and closes at 12:30 (NewYork open). Script is showing high lows only in this session range.
Always double confirm with your trading style. It's not a Financial advice.
Inputs:
1: Hide history - Hides all historical lines and prices that means you can see only todays session.
2: Show price - Shows price level of session high lows. You can hide price level if you want to see only lines.
3: Session time - You can set your time range of session.
4: Start time - Session start time. You can see vertical line on your chart or you can hide line.
5: End time - Session end time. You can see vertical line on your chart or you can hide line.
6: Line extend time - End of the high low lines. You can draw line until the end of the session or you can draw short line.
7: All line and price colors are optional.
Thank you.
Debug tool - tableWhen having a script with lot's of values, it can be difficult to seek the values you need to debug
For example, here, multiple values aren't visible anymore (right side chart)
————————————————————————————————————————————————————————————————
This script show a way where you can show the values in a table on 1 particular bar, with 2 options:
1)
'middle' -> here the script uses chart.left_visible_bar_time and chart.right_visible_bar_time to calculate the middle
the values of that bar (in orange box) is shown, you can check the value by putting your mouse cursor on that bar:
Just zooming in/out, or scrolling through history will automatically show you the middle and the values of that bar.
Using the arrows on your keyboard will allow you to go 1 bar further/back each time.
(Give it some time to load though, also, sometimes you need to click anywhere on the chart before arrows start working)
2)
'time' -> settings -> Date -> the orange bar will be placed on the chosen bar, the values will be placed in the table as well.
————————————————————————————————————————————————————————————————
If the table interfere with the candles, you can alter the position without changing the placement of the orange bar -> settings -> position table
This script holds lots of values, just to show the difference between values placed on the chart, and values, placed in the table.
To make more clear how the script works, an 'example' (v_rsi1 / rsi1) is highlighted in the code itself
Cheers!
2x take profit, move stop loss to entryTwo take profit targets moving stop loss to entry after first take profit hit
This strategy shows a method to achieve the following trade management:
1) Open a position with two take profit targets
2) When first take profit is hit, move the stop loss to entry price
3) Position is closed when either second take profit is hit or position is stopped out at entry
Trading Conditions
The trading conditions used in this script are for illustrative purposes only and are not meant to be profitable.
Bollinger Bands
Used to show areas where price is moving outside of the normal range
Stochastic
Used to show overbought and oversold conditions.
Green dots are plotted when the K line crosses over its SMA. Red dots are plotted when the K line crosses under its SMA.
The option to use overbought/oversold thresholds is again illustrative.
Quantity Theory of Money (Inflation Growth Rate)Quantity Theory of Money ( Inflation Growth Rate)
Equation:
%ΔM+%ΔV=%ΔP+%ΔY
M - Money Supply , V - Money Velocity , Y - Real GDP, P - Price
This script only takes into account money supply theory and does not account for increases/decreases in inflation due to energy costs. QTM Calculation is compared to USIRYY , USCCPI , and Sticky Price CPI . Flex_CPI and Flex_Core_CPI are not available in Trading View for comparison.
Simple Moving Average Default it set to 3 quarters for smoothing purposes. You can change this via the input window as you see fit.