Future TimevalueThis indicator plots a chart of future timevalue for all NSE index and NSE FNO Stock. It plots the difference of future and spot's 1min candle close price.
Just open any index or stock spot chart in 1 min timeframe(works with higher tf also) and add the indicator.
Futures
Timed_exit_alert_for_webhookLibrary "Timed_exit_alert_for_webhook"
TODO: add library description here
fun(x) TODO: add function description here
Parameters:
x : TODO: add parameter x description here
Returns: TODO: add what function returns
for exiting FCM like Tradovate and AMP using API and python MT5 and Webhooks
the writer take no responsibility for trades made using this script its written for informational purposes only
ICT Index Futures Vertical LinesLearning to trade is complicated enough, so to make the process it little less daunting, I decided to create something helpful.
This indicator relieves you of drawing the same lines and levels over and over each trading day.
It also provides key price levels for you to watch when the trading session starts.
This project is inspired by the ICT 2022 Mentorship.
This indicator was designed and tested to practice and trade the CME Index Futures like Nasdaq, S&P500 and the DOW.
The concepts by ICT are known to work on other markets like Crypto, but I haven't tested that so use at your own risk.
Features:
When a new trading day starts, the following lipstick is put on the chart:
Vertical lines:
- Globex (Overnight) Session Start @17.00
- New York Midnight @ 00:00
- New York AM Session Start @ 08.30
- CME Open @ 09.30
- New York Lunch Start @12.00
- New York PM Session Start @13.00
- New York PM Session End @ 16.30
Important levels:
- Globex (Overnight) Session Opening price
- Globex (Overnight) Session High
- Globex (Overnight) Session Low
- New York Mignight Opening Price
Additional features:
- Shows the day of the week at the bottom for your convenience
- London Killzone Vertical lines
- London Killzone Highlight
- NY Lunch No-Trade-Zone Highlight
- Important levels have a small label to show their meaning and price
- Almost everything is customizable: colors, line types, times, etc
- Customizable timezone setting in case you don't want to work on ICT's recommended timezone (New York UTC-4)
- Toggle to Show only Today's drawings on the chart. You can choose to display all chart lipstick from almost a month of trading data to do your research. Ideal if you want to determine the daily profiles for example.
Screenshots:
London Killzone Highlight turned on:
Multi Day Lipstick:
Settlement priceThis script is meant to be used intraday, on futures products.
It charts the previous day/week/month settlement price as a constant level intraday.
The settlement price of a product is calculated by the exchange at the end of each day. It is shown in the D/W/M chart as the close price. The settlement price does not coincide with the last close price intraday, thus creating the need of a script like this.
The settlement price can be a pivotal price in intraday futures trading, as it can act as support or resistance
You can select the resolution of the settlement by the "Resolution" input
Binance Futures/Spot PriceShows the last price of either the spot or futures market on Binance, for the current coin.
It shows futures if you are in a spot market, and spot if you are in futures.
Currently this only works for USD stable coin pairs (BUSD, USDT, USDC, ...).
I don't plan to add COIN future pairs, it's not useful to me.
Additionally, it allows you to show the lowest and highest traded price (in the opposite market you are currently on: spot/futures) for a given period, and the respective chart, if you are into that sort of thing.
Bye :D
FX Mini-Day/Index Dividers V2This is a combination of the Mini-Day Separator Indicator, timings based off the research by Tom Henstridge/@LiquiditySniper and additional Index KZ delineations, based on ICT's 2022 Youtube Mentorship.
*It borrows some minor code from Enricoamato997 . Credit where it is due!
This is a joint effort by myself, @vbwilkes / Offseason Vince and @Tom_FOREX / TraderTom on the Index/Index Future portion.
Index Future Example
Forex Example
LibraryCOT█ OVERVIEW
This library is a Pine programmer's tool that provides functions to access Commitment of Traders (COT) data for futures. Four of our scripts use it:
• Commitment of Traders: Legacy Metrics
• Commitment of Traders: Disaggregated Metrics
• Commitment of Traders: Financial Metrics
• Commitment of Traders: Total
If you do not program in Pine and want to use COT data, please see the indicators linked above.
█ CONCEPTS
Commitment of Traders (COT) data is tallied by the Commodity Futures Trading Commission (CFTC) , a US federal agency that oversees the trading of derivative markets such as futures in the US. It is weekly data that provides traders with information about open interest for an asset. The CFTC oversees derivative markets traded on different exchanges, so COT data is available for assets that can be traded on CBOT, CME, NYMEX, COMEX, and ICEUS.
Accessing COT data from a Pine script requires the generation of a ticker ID string for use with request.security() . The ticker string must be encoded in a special format that includes both CFTC and TradingView-specific content. The format of the ticker IDs is somewhat complex; this library's functions make their generation easier. Note that if you know the COT ticker ID string for specific data, you can enter it from the chart's "Symbol Search" dialog box.
A ticker for COT data in Pine has the following structure:
COT:__<_metricDirection><_metricType>
where an underscore prefixing a component name inside <> is only included if the component is not a null string, and:
Is a digit representing the type of the COT report the data comes from: "" for legacy COT data, "2" for disaggregated data and "3" for financial data.
Is a six digit code that represents a commodity. Example: wheat futures (root "ZW") have the code "001602".
Is either "F" if the report data should exclude Options data, or "FO" if such data is included.
Is the TradingView code of the metric. This library's `metricNameAndDirectionToTicker()` function creates both
the and components of a COT ticker from the metric names and directions listed in the above chart.
The different metrics are explained in the CFTC's Explanatory Notes .
Is the direction of the metric: "Long", "Short", "Spreading" or "No direction".
Not all directions are applicable to all metrics. The valid ones are listed next to each metric in the above chart.
Is the type of the metric, possible values are "All", "Old" and "Other".
The difference between the types is explained in the "Old and Other Futures" section of the CFTC's Explanatory Notes .
As an example, the Legacy report Open Interest data for ZW futures (options included) in the old standard has the ticker "COT:001602_FO_OI_OLD". The same data using the current standard without futures has the ticker "COT:001602_F_OI".
█ USING THE LIBRARY
The first functions in the library are helper functions that generate components of a COT ticker ID. The last function, `COTTickerid()`, is the one that generates the full ticker ID string by calling some of the helper functions. We use it like this in our example:
exampleTicker = COTTickerid(
COTType = "Legacy",
CFTCCode = convertRootToCOTCode("Auto"),
includeOptions = false,
metricName = "Open Interest",
metricDirection = "No direction",
metricType = "All")
This library's chart displays the valid values for the `metricName` and `metricDirection` arguments. They vary for each of the three types of COT data (the `COTType` argument). The chart also displays the COT ticker ID string in the `exampleTicker` variable.
Look first. Then leap.
The library's functions are:
rootToCFTCCode(root)
Accepts a futures root and returns the relevant CFTC code.
Parameters:
root : Root prefix of the future's symbol, e.g. "ZC" for "ZC1!"" or "ZCU2021".
Returns: The part of a COT ticker corresponding to `root`, or "" if no CFTC code exists for the `root`.
currencyToCFTCCode(curr)
Converts a currency string to its corresponding CFTC code.
Parameters:
curr : Currency code, e.g., "USD" for US Dollar.
Returns: The corresponding to the currency, if one exists.
optionsToTicker(includeOptions)
Returns the part of a COT ticker using the `includeOptions` value supplied, which determines whether options data is to be included.
Parameters:
includeOptions : A "bool" value: 'true' if the symbol should include options and 'false' otherwise.
Returns: The part of a COT ticker: "FO" for data that includes options and "F" for data that doesn't.
metricNameAndDirectionToTicker(metricName, metricDirection)
Returns a string corresponding to a metric name and direction, which is one component required to build a valid COT ticker ID.
Parameters:
metricName : One of the metric names listed in this library's chart. Invalid values will cause a runtime error.
metricDirection : Metric direction. Possible values are: "Long", "Short", "Spreading", and "No direction".
Valid values vary with metrics. Invalid values will cause a runtime error.
Returns: The part of a COT ticker ID string, e.g., "OI_OLD" for "Open Interest" and "No direction",
or "TC_L" for "Traders Commercial" and "Long".
typeToTicker(metricType)
Converts a metric type into one component required to build a valid COT ticker ID.
See the "Old and Other Futures" section of the CFTC's Explanatory Notes for details on types.
Parameters:
metricType : Metric type. Accepted values are: "All", "Old", "Other".
Returns: The part of a COT ticker.
convertRootToCOTCode(mode, convertToCOT)
Depending on the `mode`, returns a CFTC code using the chart's symbol or its currency information when `convertToCOT = true`.
Otherwise, returns the symbol's root or currency information. If no COT data exists, a runtime error is generated.
Parameters:
mode : A string determining how the function will work. Valid values are:
"Root": the function extracts the futures symbol root (e.g. "ES" in "ESH2020") and looks for its CFTC code.
"Base currency": the function extracts the first currency in a pair (e.g. "EUR" in "EURUSD") and looks for its CFTC code.
"Currency": the function extracts the quote currency ("JPY" for "TSE:9984" or "USDJPY") and looks for its CFTC code.
"Auto": the function tries the first three modes (Root -> Base Currency -> Currency) until a match is found.
convertToCOT : "bool" value that, when `true`, causes the function to return a CFTC code.
Otherwise, the root or currency information is returned. Optional. The default is `true`.
Returns: If `convertToCOT` is `true`, the part of a COT ticker ID string.
If `convertToCOT` is `false`, the root or currency extracted from the current symbol.
COTTickerid(COTType, CTFCCode, includeOptions, metricName, metricDirection, metricType)
Returns a valid TradingView ticker for the COT symbol with specified parameters.
Parameters:
COTType : A string with the type of the report requested with the ticker, one of the following: "Legacy", "Disaggregated", "Financial".
CTFCCode : The for the asset, e.g., wheat futures (root "ZW") have the code "001602".
includeOptions : A boolean value. 'true' if the symbol should include options and 'false' otherwise.
metricName : One of the metric names listed in this library's chart.
metricDirection : Direction of the metric, one of the following: "Long", "Short", "Spreading", "No direction".
metricType : Type of the metric. Possible values: "All", "Old", and "Other".
Returns: A ticker ID string usable with `request.security()` to fetch the specified Commitment of Traders data.
█ AVAILABLE METRICS
Different COT types provide different metrics. The table of all metrics available for each of the types can be found below.
+------------------------------+------------------------+
| Legacy (COT) Metric Names | Directions |
+------------------------------+------------------------+
| Open Interest | No direction |
| Noncommercial Positions | Long, Short, Spreading |
| Commercial Positions | Long, Short |
| Total Reportable Positions | Long, Short |
| Nonreportable Positions | Long, Short |
| Traders Total | No direction |
| Traders Noncommercial | Long, Short, Spreading |
| Traders Commercial | Long, Short |
| Traders Total Reportable | Long, Short |
| Concentration Gross LT 4 TDR | Long, Short |
| Concentration Gross LT 8 TDR | Long, Short |
| Concentration Net LT 4 TDR | Long, Short |
| Concentration Net LT 8 TDR | Long, Short |
+------------------------------+------------------------+
+-----------------------------------+------------------------+
| Disaggregated (COT2) Metric Names | Directions |
+-----------------------------------+------------------------+
| Open Interest | No Direction |
| Producer Merchant Positions | Long, Short |
| Swap Positions | Long, Short, Spreading |
| Managed Money Positions | Long, Short, Spreading |
| Other Reportable Positions | Long, Short, Spreading |
| Total Reportable Positions | Long, Short |
| Nonreportable Positions | Long, Short |
| Traders Total | No Direction |
| Traders Producer Merchant | Long, Short |
| Traders Swap | Long, Short, Spreading |
| Traders Managed Money | Long, Short, Spreading |
| Traders Other Reportable | Long, Short, Spreading |
| Traders Total Reportable | Long, Short |
| Concentration Gross LE 4 TDR | Long, Short |
| Concentration Gross LE 8 TDR | Long, Short |
| Concentration Net LE 4 TDR | Long, Short |
| Concentration Net LE 8 TDR | Long, Short |
+-----------------------------------+------------------------+
+-------------------------------+------------------------+
| Financial (COT3) Metric Names | Directions |
+-------------------------------+------------------------+
| Open Interest | No Direction |
| Dealer Positions | Long, Short, Spreading |
| Asset Manager Positions | Long, Short, Spreading |
| Leveraged Funds Positions | Long, Short, Spreading |
| Other Reportable Positions | Long, Short, Spreading |
| Total Reportable Positions | Long, Short |
| Nonreportable Positions | Long, Short |
| Traders Total | No Direction |
| Traders Dealer | Long, Short, Spreading |
| Traders Asset Manager | Long, Short, Spreading |
| Traders Leveraged Funds | Long, Short, Spreading |
| Traders Other Reportable | Long, Short, Spreading |
| Traders Total Reportable | Long, Short |
| Concentration Gross LE 4 TDR | Long, Short |
| Concentration Gross LE 8 TDR | Long, Short |
| Concentration Net LE 4 TDR | Long, Short |
| Concentration Net LE 8 TDR | Long, Short |
+-------------------------------+------------------------+
Session Levels - Ultimate Range IndicatorSession Levels - Ultimate Range Indicator
Primarily developed for trading the E-MINI Futures Markets like NQ or ES from the CME Group,
but also more than suitable for Crypto or other instruments.
This indicator highlights the chosen session, which can be Globex, Asian, London and New York.
It plots the important levels and also renders the Opening Range as it forms (a.k.a. Initial Balance).
After the 1st hour Opening Range is finished, it can plot the Standard Deviations / Projections.
See below for a complete feature list.
All Opening Ranges on chart and for the New York session the Range Projections are turned on:
s3.tradingview.com
How to use (example):
If you are trading the Nasdaq Futures (NQ!)
Enable the Globex Overnight session. Basically in the Futures Market, the Globex session is everything outside of US trading hours of Stocks. This draws the important overnight levels, like the Low, 25%, 50%, 75% and the High.
Enable the New York Session with Levels and Opening Range. Generally, 70% of the time the 1st hour will put a Low or High of the day.
If the price is trading above the Globex Low, most likely the Low of the Day is formed and the price target for the day will be 1.5x Standard Deviation and 2x Standard Deviation.
[*} Deviation of the Initial Balance depends on the volume ad overall market structure.
** This is not financial advice or any guarantee **
Features:
Show each Session Highlighted on Intraday chart in it's own color (each session can be turned off and has customizable times and color)
Show Line Levels of each session: Low, 25%, 50%, 75% and the High (customizable color)
Show the Opening Range (Initial Balance) of the Asian, London and New York session. Note: NY has more options.
Opening Range is displayed as a box with level lines (customizable color)
Levels are drawn to the end of the NY Cash session (customizable time)
Show IB Standard Deviations 0.5 - 3.0. Calculated from the Opening Range (Initial Balance)
Option to display Higher Timeframe levels: Previous Day Open/Close and Previous Week Open/Close
All level lines and OR boxes size dynamically as the session progresses
Built in Alerts for when price hits key levels. e.g. Alert when price crosses the NY Opening Range High. Or an Alert when the first STDEV is hit.
Option to toggle display of drawings for Today's trading session only, or Show all recent session levels. This keeps the chart clean or not.
Extras:
The NY Opening Range also has a 50% level line
The NY Opening Bar can be highlighted separately
The Level Lines can have small labels turned on/off. Values are only shown on mouse over to keep a clean chart
Keep in mind:
1) This indicator works on all instruments, but on instruments with limited market hours, your chart setting
has to be set to "Extended Hours" otherwise. For example TSLA on NASDAQ.
2) The Exchange Time Zone for the CME Group is Chicago UTC-6. So the session times you configure in the settings menu are based on that timezone too.
3) Globex opens at 5pm CST and closes when the US session starts 8:30CST.
4) When enabling the Alerts in the Indicator settings, be sure to also create an alarm for this indicator using the Alarm function of Tradingview.
BTC Futures BasisShows various basis percentages in a table and plots historical basis. Also has an alert function for backwardation events. Useful for tracking bullish/bearish sentiment in BTC futures markets.
*Currently displays March and June futures for the following exchanges: Bitmex, Binance, Deribit, Okex, and FTX
Also displays CME Continuous Next Contract. All of the symbols are customizable.
-----------
Market-wide backwardation usually occurs during a heavy sell-off (such as a liquidation cascade).
**For getting alerts of backwardation events, I recommend creating an alert on the 1 minute chart with the condition "Any alert() function call". Alert level is customizable as well.
-----------
*NOTE!! : Futures contracts expire (obviously), so the contract symbols will need to be updated periodically. I will try to keep them updated going into the future.
**NOTE2!! : The alert() function does not track the CME contract. This is to avoid false triggers.
Aggregated BTC SpreadThis script is used to aggregate the bitcoin spread on futures contracts on different platforms.
It works by averaging the for every selected exchange, and apply an EMA of .
It is supporting
Binance (USD / USDT)
Okex
FTX
Huobi
Deribit
Ascendex
CME (BTC1!)
Confluence CandlesThis indicator looks for confluence among three indicators (RSI, Stochastic, and MACD), a strategy popularized by Markus Heitkoetter in his book, “The PowerX Strategy: How to Trade Stocks and Options in Only 15 Minutes a Day”, and expands it to look for agreement on up to four symbols.
Each indicator is configurable in the settings, as well as the ability to choose which of the indicators are used.
Default Logic
Green Candles
RSI > 50
Stochastic > 50
MACD Histogram > 0
Red Candles
RSI < 50
Stochastic < 50
MACD Histogram < 0
When multiple symbols are selected, the above needs to be true for all selected symbols.
Example Use Cases
- Setting the indicator to the Nasdaq 100 (QQQ or NQ1!) while trading a stock that is part of that index such as AAPL or TSLA
- Setting the indicator to multiple indexes that tend to move together in order to trade one of them since they tend to make stronger moves when moving together (ex. SPY & QQQ, or ES1! & NQ1!)
- Setting the indicator to Bitcoin while trading a smaller crypto pair that moves as a sympathy play.
Tip
If you have trouble finding the full name for a specific instrument from an exchange such as BTCUSD from Coinbase, you can bring up TradingView’s “Symbol Search” pop-up modal, enter your search term, use the down arrow key on your keyboard to move the focus to the symbol you want, and you will see the full name in the search field such as “COINBASE:BTCUSD”.
Premium Rolling APY CalculatorThis script can see the rolling APY of future premiums calculated based on the remain days to expire date.
By default you can see the rolling APY for FTX BTC0924, and APY for BTC1231. You can also change the symbol from chart settings to whatever you need and still calculate in the same way.
vix_roll_yieldShows the roll yield of the VX futures, which is the ratio of a continuously weighted average of the front two months to the VIX. The VX (VIX futures) contract expires on the third Tuesday of each month. On the next trading day, the front month will have full weighting, and the second month will have no weight. On the expiration day, the back month will have full weighting and the front month will have no weight. In between, the weight gradually shifts.
This weighted average is similar to the SPVIXSTR index that UVXY and several other funds track. When the average is below the VIX, the indicator is negative, and the front month contract will tend to gain value relatively more rapidly than the back month as it converges upward to the VIX spot price. Because funds whose NAV is tied up in VX contracts continuously roll from the (typically cheaper) front month to the back, in situations where the front month is more expensive than usual--or even more expensive than the back month--these products may have a "tailwind". In this case, they are selling expensive front month contracts to purchase cheap back month contracts.
Ordinarily, VIX funds have a "headwind." The roll yield is positive, the front month is cheap, and the back month is expensive. Day by day the funds sell cheap front month contracts and buy expensive back month contracts, which, in turn and over time, become the front month and converge with the VIX, losing value rapidly. This is a brief explanation about the decay of these products.
Trend Momentum with Buyers / Sellers PowerHi there!
With this indicator, you can hunt big trends before they start.
This indicator is combined with RSI and Momentum indicators
It can show you the power of trend and which side it wants to go
It can help you to open a position at the first point of a new trend or at the safe and proven point of the trend, also it can help you to close your position before the trend change its direction (it's not recommended to use it to close your positon, but sometimes it can help you to find the ending point of big pumps)
Rules:
* Baseline is ZERO ( 0 ) line
* When gray line crossover red line, it shows us a powerful uptrend
* When the gray line crossunder the red line it shows us a powerful upward trend
Signals:
* Only use Buy signals(Long) when they are above or crossing-up baseline
* Only use Sell signals(Short) when they are under or crossing-down baseline
* If they both (red and gray lines) are too high and they suddenly starting to come back to baseline, it shows we have a range trend, the trend is weak or a reversal trend is coming!!
!! WARNING: DO NOT USE THIS INDICATOR ALONE !!
Suggestions :
-Use 1H, 4H, daily, or Weekly timeframes
-Use ADX and DI or three WMA's
-Use divergence
-You can use it for scalping but you need to change the inputs (not recommended)
If you have any idea about making new indicators(what information do you want from the chart?), comment please, then I can research and make it for all of us! =)
Stock trending strategy This is a long only strategy designed maily for stock markets and futures. In general it works best with 1h, however it can be optimized with other timeframes as well.
Components:
VWAP
MACD histogram
EMA 9
Rules for entry
Long :
For VWAP: close is above the vwap daily
EMA: close is above the moving average
MACD histogram is above 0
Short:
For VWAP: close is belowthe vwap daily
EMA: close is below the moving average
MACD histogram is below 0
Rules for exit
This strategy does not have any risk management inside. Instead it exits whenver it receives an opposite signal form the original one used for entry.
If you have any questions let me know !
Ichimoku with MACD/ CMF/ TSIThis is a very powerful trend strategy designed for markets such as stocks market , stock index and crypto.
For time frames I found out that 1h seems to do the trick.
Components:
Ichimoku full pack
MACD histogram
CMF oscillator
TSI oscillator
Rules for entry
Long :
For Ichimoku:Tenkan part of cloud is bigger than kijun, Chikou is above 0 , close of a candle is above the Senkou
MACD histogram is above 0
CMF oscillator is positive and bigger than 0.1
TSI oscillator is above 0
Short:
For Ichimoku:Tenkan part of cloud is smaller than kijun, Chikou is below 0 , close of a candle is belowthe Senkou
MACD histogram is below 0
CMF oscillator is negative and below -0.1
TSI oscillator is below 0
Rules for exit
This strategy does not have any risk management inside. Instead it exits whenver it receives an opposite signal form the original one used for entry.
If you have any questions let me know !
quarter level dinamicLimited quarter level script but more flexible in compared to my FX script, same logic behind
Trade Vertex - Bank Nifty Volume IndicatorNSE:BANKNIFTY
We all know that the value of an Bank Nifty is derived from top banking sector underlying stocks.
The value of Bank Nifty is calculated from free float market capitalization.
Using the same formula, I made an indicator on the bases of weighted volume of each stock.
This indicator will help you to plot Volume on Bank Nifty.
Target Price for KuCoin FuturesWhen trading on KuCoin, it can be difficult to determine what you're exit price should be.
This script solves this issue by giving you an exit price based on a given entry price, a base margin, and a target profit %.
USE CASES:
No Entry Price:
If you have no position in KuCoin, then this use case could be more helpful. With no entry price inputted, two lines will be drawn above and below the current closing price.
The blue line represents your exit price for if you were to enter into a long at the current close.
The orange line represents your exit price if you were to enter into a short at the current close.
With Entry Price:
If you're already in a position in KuCoin, then this case might be more helpful.
The green line represents your exit price for a long from your entry price
The red line represents your exit price for a short from your entry price
The yellow line represents your entry price itself.
Noncommercial long futures position to overall Open InterestThis is an indicator that gets data from Quandl and presents weekly CFTC futures data (www.cftc.gov). In this indicator, the noncommercial long/short positions are calculated as a percentage of overall Open Interest. This indicates the bullish/bearish sentiment of the market.
Futures OI and Net positionsThis is an indicator that gets data from Quandl and presents weekly CFTC futures data (www.cftc.gov). In this indicator, Open Interest (OI) and net noncommercial positions are presented. Net_noncommercial positions are calculated as noncommercial_long - noncommercial_short.
FTX Futures Premium %Charts the Futures Premium % for FTX futures markets
Change the asset name from BTC to ETH in settings to switch assets, and will work with all assets with long-dated futures markets on FTX as they are added