Examples of Rolling Average Using Automated AnchoringIn this study, I present a method to expose NaN values to development environment.
This exposure allows NaN values to be used by methods in scripts.
I also show how to use values, even NaN values, as anchors from which statistics can be computed from.
I demonstrate how to do this with constants and variables in methods for computing the cumulative/rolling average of a series.
I also show how to calculate the cumulative/rolling average from the start of a ticker series using the aforementioned methods.
Each method has a description on how some of their parts work as well as their constraints.
Method #1 - Can only be used for computing the rolling average on the ticker series.
Method #2 - The simple moving average from the Pine Script reference.
- Can be used to calculate the rolling average of the ticker series and number values of a series.
- This method seems to cause an error when there are many bars in the series.
Method #3 - The most versatile method due to the use of computing the rolling average using an array.
- Timeout will occur when computing the rolling average of an entire ticker series which is long.
- Timeout has not occurred when computing a rolling average of a series from NaN or non-NaN anchor points even when the series is long.
This is an attempt to get around the constraints of the built-in sma(source, length) function in which length cannot be dynamically adjusted.
Other Pine Script functions have that constraint which we can get around by defining our own functions.
Cari skrip untuk "文华财经tick价格"
Spread Entry StrengthThis is an overlay indicator showing a strong potential for entry into an option spread trade.
2 background shadings will occur:
The background will shade blue if the ticker is prime for a Bullish Call spread.
The background will shade purple if the the ticker is prime for a Bearish Put spread.
In theory, if the SE Strength is at one of the extremes of the Bear or Bull side, then a spread is prime for entry.
To calculate this, 8 conditions receive a 1 or zero dependent on whether the condition is true (1) or false (0), and then all of those are summed. The primary gist of the strength comes from Nishant's book, or my interpretation thereof, with some additives that limits what I need to review (such as condition 8 below.)
The 8 Bull Conditions are:
1) Bollinger Bands are outside of the Keltner Channels
2) ADX is trending up
3) RSI is trending up
4) -DI is trending down
5) RSI is under 30
6) Price is below the lower Keltner Channel
7) Price is between the lower Bollinger Band and the Bollinger basis.
8) Price at one point within the last 5 bars was below the lower Bollinger Band
The 8 Bear Conditions are the inverse conditions (except the first):
1) Bollinger Bands are outside of the Keltner Channels
2) ADX is trending down
3) RSI is trending down
4) +DI is trending up
5) RSI is over 70
6) Price is above the upper Keltner Channel
7) Price is between the upper Bollinger Band and the Bollinger basis.
8) Price at one point within the last 5 bars was above the upper Bollinger Band
There is a "market noise" filter that will filter out shading when another market move is considered, i.e. if you don't want to see the potential trade when QQQ moves more than 1% then do the following in the settings:
Check "Market Filter"
Enter QQQ in the "Market Ticker To Use"
Enter 1 in the "Market Too Hot Level"
Press Ok
Obviously, the same holds true for the "Market Too Cool Filter."
Arbitrage BR STOCK / USA STOCKThis Indicator was made to show the BRL difference between an Stock in Brazil's B3 and it's respective ADR traded in the USA.
By default, it will show the spread between PETR4 and it's ADR PBR.A using the USD-BRL pair from Forex.
You can personalize this indicator to any Stock of your preference, and also change to any USD-BRL pair negotiated that you want. You'll have the following options to do so:
B3's Stock Ticker -> Ticker negotiated at B3.
USA's Stock Ticker -> The respective ADR of the first option.
ADR's Multiplicative Factor -> How many B3's Stocks are equivallent to the USA Stock (found at the name of the ADR on Trade View).
BRL/USD Market of Preference -> Which market you want to use to transform the price of the ADR from USD to BRL.
Dollar Divisor -> The BRL must be equivallent to 1 Dollar for the script to work. So, if you want to use a USD/BRL market that does not represent this relation, you must divide it by some number to do so. For example, if you want to use B3's DOLFUT, than you must set this parameter to 1000 (because the points show at B3's DOLFUT are the amount of BRL equivallent to 1000 Dollars). Also, if you are using a market that trades Dollar equivalent to 1 BRL (Globex's 6LFUT, for example), then set this parameter to 0.
Timeframe -> Recommended to be the same of the chart to better visualisation.
Data structure map[string, float]The script shows a workaround for map in pine-script via drawings.
There are few restrictions with them:
1. The size of the map cannot be more that amount of allowed drawings (about 40 by now)
2. Because the map shares the space of drawings throughout the whole script, using drawings with the map must be careful, with handly creating and removing of each drawing, because otherwise pine's garbage collector might break the stack. I'd recommend not using more drawings with the map.
3. setters and getters must be called on every bar, because of implementation of functions in pine there are inner serieses, which must be updated on every bar. So wherever you have a setter or getter in the code - it must be called on every bar. But if it's just an update, then you should pass 'false' as a param of the funtion.
The script shows a way to work with the map: filling it with some tickers and values for each of it and then plot the value if the symbol on the chart equals to one of the tickers in the map.
And there are some examples of updating of the value and removing of the item from the map.
Elder ray ( Bull power and bear power combined )Elder-ray is an indicator named for its similarity to x-rays.
It shows the structure of bullish and bearish
power below the surface of the markets. Elder-ray combines a trend-
following moving average with two oscillators to show when to enter
and exit long or short positions.
A moving average reflects the average consensus of value. The high of
each bar reflects the maximum power of bulls during that bar. The low of
each bar marks the maximum power of bears during that bar.
Elder-ray works by comparing the power of bulls and bears during each
bar with the average consensus of value. Bull Power reflects the maximum
power of bulls relative to the average consensus, and Bear Power the max-
imum power of bears relative to that consensus.
When the high of a bar is above the EMA, Bull Power is positive. When
the entire bar sinks below the EMA, which happens during severe de-
clines, Bull Power becomes negative. When the low of a bar is below the
EMA, Bear Power is negative. When the entire bar rises above the EMA,
which happens during wild rallies, Bear Power becomes positive.
The slope of a moving average identifies the current trend of the mar-
ket. When it rises, it shows that the crowd is becoming more bullish; it is
a good time to be long. When it falls, it shows that the crowd is becoming
more bearish; it is a good time to be short. Prices keep getting away from
a moving average but snap back to it, as if pulled by a rubber band. Bull
Power and Bear Power show the length of that rubber band. Knowing the
“Buy low, sell high” sounds good, but traders and investors seem to have
been more comfortable buying Lucent above 70 than below 7. Perhaps they
are not as rational as the efficient market theorists would like us to believe?
Elder-ray gives rational traders a glimpse into what is going on below the sur-
face of the market.
When the trend, identified by the 22-day EMA, is down and bulls are
under water, the rallies back to the surface mark shorting opportunities
normal height of Bull or Bear Power reveals how far prices are likely to get
away from their moving average before returning. Elder-ray offers one of
the best insights into where to take profits—at a distance away from the
moving average that equals the average Bull Power or Bear Power.
Elder-ray gives buy signals in uptrends when Bear Power turns nega-
tive and then ticks up. A negative Bear Power means that the bar is strad-
dling the EMA, with its low below the average consensus of value. Waiting
for Bear Power to turn negative forces you to buy value rather than chase
runaway moves. The actual buy signal is given by an uptick of Bear Power,
which shows that bears are starting to lose their grip and the uptrend is
about to resume. Take profits at the upper channel line or when a trend-
following indicator stops rising. Profits may be greater if you ride the
uptrend to its conclusion, but taking profits at the upper channel line is
more reliable.
Elder-ray gives shorting signals in downtrends when Bull Power turns
positive and then ticks down. We can identify the downtrend by a declin-
ing daily or weekly EMA. A positive Bull Power shows that the bar is strad-
dling the EMA, with its high above the average consensus of value.
Waiting for Bull Power to turn positive before shorting forces you to sell
at or above value instead of chasing waterfall declines. The actual short-
ing signal is given by a downtick of Bull Power, which shows that bulls
are starting to slip and the downtrend is about to resume. Once short, take
profits at the lower channel line or when the trend-following indicator
stops falling, depending on your style.
FREE TRADINGVIEW FOR TIMEFRAMESWhen doing i.e the 3 minute timeframe turn on the closest timeframe available for you or the candles and wicks will be fucked up.
So if you're doing the 5 hour timeframe candles turn on the 4hr chart on your main chart.
To View the candles in full screen double click the windows with the candlesticks
If you don't have TradingView premium and want to look at custom timeframes you can use this.
For the ticker/coin/pair you want to show enter it like this:
For stocks, only the ticker i.e: MSFT, APPL
For Crypto, "Exchange:ticker" i.e: BITFINEX:BTCUSD, BINANCE:AGIBTC, BITMEX:ADAM19
When setting up the timeframe write i.e:
For minutes/hourly: 5, 240 (4 hour), 360 (6 hour)
For daily/weekly/monthly: 1D, 2W, 3M
When doing i.e the 3 minute timeframe turn on the closest timeframe available for you or the candles and wicks will be fucked up.
So if you're doing the 5 hour timeframe candles turn on the 4hr chart on your main chart.
RSI MTF by PeterOThis is my take on reaching Higher TimeFrame charts, what is usually helpful when determining the trend. On the example of RSI.
So imagine you want to check RSI from higher timeframe. 15x higher for example. There are 3 ways to do it.
1. security(tickerid,"15",rsi(close,14))
DON'T!!! I strongly advise against this method. Security() function is buggy in PineScript, leads to so-called "repainting" issues. Repainting is caused by creating leak from future data and leads to abnormally fantastic strategy backtest results like the one in Open Close Cross Strategy. Theoretically speaking if security() used correctly - with Pine version3 and barmerge.lookahead_off - you should encounter no repainting, but I could swear I saw scripts repaint even with security() implemented properly.
Even assuming security() implemented correctly will not repaint - it will create delay in your script. I'm using "15" multiplier in my example, and this means, I have to wait for 15 candles to close to produce indicators value. If a strong move happens in the meantime, I'm blind, because I have to wait anyway.
So for your own security, stay away from security() at all times.
2. rsi(close,14*15)
This will produce RSI plot with no delay, but a very flattened one. RSI will move between 45 and 45, never even reaching 30 or 70 levels. So pretty useless.
3. Dig-in-the-formula way.
Doing a bit more math produces RSI line, which is not delayed, not repainting and moving in full 0-100 RSI range. Actually - looking almost identical to the one from the higher timeframe. Which was the goal of this script.
Godmode 4.0.2 [Supply/Demand]First off, a huge thank you to the following people:
LEGION:
LazyBear: www.tradingview.com
xSilas: www.tradingview.com
Ni6HTH4awK: www.tradingview.com
sco77m4r7and:
SNOW_CITY: www.tradingview.com
oh92: www.tradingview.com
alexgrover: www.tradingview.com
cI8DH: www.tradingview.com
DonovanWall: www.tradingview.com
shtcoinr: www.tradingview.com
This is the third iteration of Godmode. This time I borrowed the method used by shtcoinr to render supply/demand, resistance and support zones. The idea here is to input the appropriate benchmark tickerid to the asset class you're trading and to paint zones according to the price activity of the selected tickerid. This works very well trying to paint meaningful zones against noisy stocks, currencies, commodities etc. Use a correlation coefficient to determine the best benchmark for your asset class.
Want to Learn?
If you'd like the opportunity to learn Pine but you have difficulty finding resources to guide you, take a look at this rudimentary list: docs.google.com
The list will be updated in the future as more people share the resources that have helped, or continue to help, them. Follow me on Twitter to keep up-to-date with the growing list of resources.
Suggestions or Questions?
Don't even kinda hesitate to forward them to me. My (metaphorical) door is always open.
Heikin Ashi AlgorithmThis indicator can be added on any type of chart (including Heikin Ashi chart). There is a little trick with the tickerid, read details in comments.
Relative Estimated Price REP by KIVANÇ fr3762Relative Estimated Price (REP) Indicator shows the estimated price calculated if the tickerid made the same value changes (in %) during a certain period.
The default value of the lookback period is 50.
In the given XRPUSD chart you can see that XRPUSD has a value of 0.26480 and the RPC indicator shows the value of 0.38099.
This means that XRP would be 0.38099USD if it was fully made the same percentage moves with BTC , we can say that XRP is RELATIVELY cheap according to BTC price moves.
Conversely XRP would be RELATIVELY expensive if the last value of REP was lower then current XRP price.
users can choose the relative base price in calculation of REP between 1-5 which are:
1=BTCUSD, 2=ETHUSD, 3=EURTRY(Euro/Turkish Lira), 4=USDTRY (Dollar/Turkish Lira), 5=BIST100 (Istanbul Stock Exchange)
I personally advise you to use this indicator for daily charts in Tradingview to have more accurate estimated prices because of the website's calculation.
Developed by KIVANÇ
Mayer Multiple @ Current PriceThough this script is by me, the original idea comes from a podcast I heard where Trace Mayer talks about how he does crypto valuation. It is based on current price against the 200 day moving average. This indicator script will simply plot that value as a label overlayed on your trading view chart. Best long term results occur when acquiring BTC when the multiple is 2.4 or less. For more info, google "mayer multiple" This script/indicator is strictly for educational purposes. It is not exclusive to bitcoin.
To get the best look out of your charts I make the following changes.
1.Apply the indicator to your chart.
2. In the tools palette of trading view, when looking at a chart, click "Show Objects Tree" the icon displayed above the trash can.
In the objects tree panel, click the preferences icon for "Mayer Multiple @ Current Price"
Switch "scale" to "scale Left"
3. Then for your chart preferences (right click on chart background and select "Properties", and be sure the following are checked on the "Scales" tab
Left Axis
Right Axis
Indicator Last Value
Indicator Labels
Screenshots are not allowed in this view, so I can't post screenshots, but the view above is what it should look like when you are done.
For anyone who wants to see the code, here is the code of the script:
Use at will, and at your own risk.
//@version=3
// Created By Timothy Luce, inspired by Trace Mayer's 200 Day SMA cryptocurrency valuation method
study("Mayer Multiple @ Current Price", overlay=true)
currentPrice = close
currentDay = security(tickerid, "D", sma(close, 200))
mayerMultiple = currentPrice/currentDay
plot(mayerMultiple, color=#00ffaa, transp=100)
If you want to change the color, change this line: #00ffaa
Accumulation/Distribution Percentage (ADP) [Cyrus c|:D]Accumulation/Distribution Percentage ( ADP ) is used to measure money flow similar to Chaikin Money Flow ( CMF ) and Money Flow. It is the range-bound version of my previous indicator ADMF. This indicator can be used for analyzing momentum, buy/sell pressure, and overbought/oversold conditions. I believe that this indicator is more accurate than CMF and MFI (I will publish a TA about it one day!).
What to look for:
- When this indicator moves up, it means buy pressure is increasing and the other way around for sell pressure. Crossing 0 means that trend has changed in the given period (it is best to look for confirmation of buy/sell pressure in larger TFs)
- Overbought above 40 and oversold below -40 (these numbers vary depending on the security. Look for historical levels to determine overbought and oversold conditions of each security)
- Regular divergence shows that momentum of a trend is declining. Hidden divergence implies continuation of a trend. The non-bound mode should be more accurate for identifying divergence.
- Failure swings can detect potential reversals.
Please read Relative Strength Index and Money Flow for more information and similar disclaimers.
Recommendations:
- hlc3 (AKA typical price) as input source might be better than "close" as it captures more information. If you use hlc3 as a source, then change the chart type to line and set hlc3 as the source for identifying divergence.
- Use hybrid tickers e.g.(BITFINEX:BTCUSD+COINBASE:BTCUSD+BITSTAMP:BTCUSD)/3. Volume-based indicators are susceptible to wash trading/volume printing and hybrid tickers mitigate this issue.
- In non-bound mode, small TFs with longer length should be more accurate than larger TFs with standard length (same is true for many other indicators)
Background:
I have developed 4 indicators based on a simple but elegant concept of A/D ratio. A/D ratio is equal to (current close - previous close)/True Range (when there are no price gaps, True Range = High - Low)
1) What you see on ADV indicator as darker green and red is equal to A/D ratio x volume.
2) ADL indicator shows the summation of ADV
3) ADMF (or ADP in non-bound mode) shows Moving Average of ADV
4) ADP shows relative accumulation strength which is calculated as RMA (accumulations)/RMA(accumulation + distribution). ADP equation is based on RSI equation which is RMA(gains)/RMA(gains + losses). That is why these two indicators look quite similar.
PS: Please leave a like if you find these indicators useful. I am working on improvements on these and other indicators. I am trying my best to keep them as simple as possible. Please let me know in the comments if you want me to make future indicators even simpler.
--------
Complementary indicators based on the same concept:
ADL: a replacement for Chaikin's Accum/Dist, On Balance Volume, and Price Volume Trend
ADV: a replacement for regular volume indicator
ADP also has a scaled RSI and ADMF built in (ie ADMF is obsolete).
CMYK XIAM OPEN◊ Introduction
This is project XIAM, a work in progress.
Recently i came across the repainting problem.
Since then i haven't seen any bot-code that makes > 5% profit in two weeks with 0.25% fees/trade.
People who make good bots either bluff or don't share the code.
they let you rent it.
I aim to understand, learn it, write it myself. And share my findings with whoever shares with me.
◊ Origin
Based on RMI (RSI with momentum) and SMA, and values derived from those.
◊ Usage
Currently an investigative script.
◊ Theoretical Approaches
Philosophy α :: Cleansignal
:: Cleaning up the signal, from irregularities that cause unpredictable results.
Merging available tickers of a pair into one.
Merging available tickers of different coins into one in the correct proportion. (eg. Crypto market cap)
Removing Jitter, and smoothing signal without delay.
Philosophy β :: Rythmic
:: Syncing into the rythm's, to never miss the que, and trade on every theoretical low/high
Searching Amplitude, Period, Phase Shift, Frequency's of the carrier waves.
Marking Acrivity/inactivity of the carrier waves.
Partial Fractal repetition asses-able with above data?
Philosophy γ :: consequential
:: Seeking for Indicatory events and causal relations
Probability / reward.
Confirmation and culmination.
...
◊ Community
Wanna share your findings ? or need help resolving a problem ?
CMYK :: discord.gg
AUTOTVIEW :: discordapp.com
BTC CorrelationA simple script to display how correlated the current ticker is to Bitcoin.
Inputs are the number of bars to check correlation for (default 10) and the the ticker to use for BTC comparison (default is BITFINEX:BTCUSD)
Values of 1 are highly correlated (i.e. bitcoin moves up, so does your current ticker), values of -1 are inversely correlated (i.e. bitcoin moves up, your current ticker moves down).
See: www.babypips.com for some more details on correlation
Price relation viewer - add percent change of two symbols (BETA)This script is very much beta!
This is a simple script to visualize how two symbols move in relation to each other. For example if the underlying symbol is a 2x Gold ETF (meaning the ticker moves at 2x the spot price of gold---if gold goes up 3% this ticker should go up 6%) and the comparison symbol is an 2x inverse gold ETF (at gold up 3% this should move down 6%). If these ETFs were 100% accurate at tracking the price of gold then this tool would report a value of zero at all times.
Day 1
Ticker - $10
Comparison - $10
Day 2
Ticker - $12
Comp - $11
This tool value - |20%| + -|10%| = 10%
It uses a short simple moving average to smooth things out a bit (see inputs). It is important to keep your axis scale in mind when using this! Two symbols that are always near zero mean they are offsetting each other very well but the value displayed might range from 0 to 0.005, but the graphed area can make it look extreme if autoscaled.
This is a tool with very specific uses : comparing how one digital currency moves in relation to bitcoin's price, comparing how gold moves in relation to silver, etc.
Multi-Timeframe VWAPShows the Daily, Weekly, Monthly, Quarterly, and Yearly VWAP.
Also shows the previous closing VWAP, which is usually very near the HLC3 standard pivot for the previous time frame. i.e. The previous daily VWAP closing price is usually near the current Daily Pivot. Tickers interact well with the previous Daily and Weekly closing VWAP.
Enabling the STDEV bands shows 3 separate standard deviation levels, defaulted at 1, 2, and 3. The lookback period for the bands is always changing with each new bar, since the standard deviation is calculated from the current bar to the beginning of the period. This is different from bollinger bands, as the lookback is constant (usually 20 periods is the textbook default).
The STDEV bands interval of interest can be changed from Day (D), Week (W), Month (M), Quarter (Q), Year (Y).
Tickers tend to bounce very well on Daily, Weekly, and Yearly VWAP (Yes... Year). Use this code and observe the Year VWAP on several major symbols through the past few years and eyes will be opened.
Free Strategy #08 (Combo of #01 and #02) (ES / SPY)This strategy was designed to be traded on daily data on the ES and SPY—the strategy was originally developed for NinjaTrader, which displays daily ES data based on RTH hours instead of 24 hours (1440 minute) like TradingView does, so we are presenting the results on the SPY until we figure out how to overcome this hurdle.
The strategy combines the two ideas from strategy #01 and strategy #02 .
Strategy #08
Quantity 100
Slippage: 2 ticks
Commission: 4.95 per order
Net Profit: 26,044.60
Max Drawdown: 3,947.60
Buy and Hold (Custom)
Quantity 100
Slippage: 2 ticks
Commission: 4.95 per order
Entry Long: 1993-02-01 @ 43.99
Exit Long: 2017-07-28 @ 246.34
Net Profit: 20,225.10
Max Drawdown: 9,042.00
Free Strategy #02 (ES / SPY)This strategy was designed to be traded on daily data on the ES and SPY—the strategy was originally developed for NinjaTrader, which displays daily ES data based on RTH hours instead of 24 hours (1440 minute) like TradingView does, so we are presenting the results on the SPY until we figure out how to overcome this hurdle.
Strategy #02
Quantity 100
Slippage: 2 ticks
Commission: 4.95 per order
Net Profit: 10,118.30
Max Drawdown: 4.037.60
Buy and Hold (Custom)
Quantity 100
Slippage: 2 ticks
Commission: 4.95 per order
Entry Long: 1993-02-01 @ 43.99
Exit Long: 2017-07-28 @ 246.34
Net Profit: 20,225.10
Max Drawdown: 9,042.00
True Strength Indicator MTFHere is an example of a script showing a multi-time frame of TSI.
Chart below compares FX EURUSD Daily TSI to 1H TSI
Here is an updated version
study("True Strength Indicator MTF", shorttitle="TSI MTF")
resCustom = input(title="Timeframe", type=resolution, defval="60" )
long = input(title="Long Length", type=integer, defval=25)
short = input(title="Short Length", type=integer, defval=13)
signal = input(title="Signal Length", type=integer, defval=13)
price = close
double_smooth(src, long, short) =>
fist_smooth = ema(src, long)
ema(fist_smooth, short)
pc = change(price)
double_smoothed_pc = double_smooth(pc, long, short)
double_smoothed_abs_pc = double_smooth(abs(pc), long, short)
tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)
tsi = security(tickerid, resCustom,tsi_value)
plot(tsi, color=black)
plot(ema(tsi, signal), color=red)
hline(0, title="Zero")
able MACD Overview
Purpose: The indicator combines the traditional MACD (Moving Average Convergence Divergence) with a short-term “forecast” (projection) of MACD/histogram values to give early warning of momentum changes.
Typical outputs:
MACD line (fastEMA − slowEMA)
Signal line (EMA of MACD)
Histogram (MACD − signal)
Forecasted MACD or histogram projected N bars ahead
Optional buy/sell markers and alert conditions
Add the indicator to TradingView (Installation)
Open TradingView and the chart you want to apply the indicator to.
Click “Pine Editor” at the bottom of the chart.
Copy the contents of able_macd_forecast.pine into the Pine Editor window.
Click “Add to chart” (or Save then Add to chart). If it’s a study, it will appear on the chart below price.
If you plan to re-use the script, click Save and give it a meaningful name.
Inputs / Parameters (typical) Note: exact input names may differ in your script. Replace the names below with the script’s input labels when you inspect it.
Source: price source for calculations (close, hl2, etc.).
Fast Length: length for the fast EMA (commonly 12).
Slow Length: length for the slow EMA (commonly 26).
Signal Length: length for the MACD signal EMA (commonly 9).
Forecast Length / Horizon: how many bars ahead the script projects the MACD/histogram (e.g., 1–5).
Forecast Method / Smoothing: choice of projection method (linear regression, EMA extrapolation, simple slope * N, etc.) if available.
Histogram Thresholds: numeric thresholds to emphasize significant momentum (optional).
Show Forecast: toggle on/off the forecast plot.
Alerts On/Off toggles: enable or disable alert conditions baked into the indicator.
Visual / Style settings: colors, plot thickness, histogram style (columns/areas), show labels, show buy/sell arrows.
How the indicator is typically calculated (summary)
MACD line = EMA(source, fast) − EMA(source, slow)
Signal line = EMA(MACD line, signal length)
Histogram = MACD − Signal
Forecast = method-specific short-term projection of MACD or histogram (for example: extend the last slope forward, apply linear regression to MACD values and extrapolate N bars, or apply an additional smoothing and extend that value) Note: For exact math, I need to inspect the script; this is the typical approach.
How to read the indicator (signals & interpretation)
Bullish signal:
MACD line crossing above the signal line (MACD cross up).
Histogram turns positive (cross above zero).
Forecast shows MACD/histogram moving higher in the next N bars (if forecast is positive or trending up).
Bearish signal:
MACD line crossing below the signal line (MACD cross down).
Histogram turns negative (cross below zero).
Forecast shows MACD/histogram moving lower ahead.
Confirmations:
Use price action (higher highs/lows for bullish, lower highs/lows for bearish).
Volume or other momentum/confluence indicators (RSI, ADX).
Divergences:
Bullish divergence: price makes lower low while MACD histogram makes higher low.
Bearish divergence: price makes higher high while MACD histogram makes lower high.
Forecast behavior:
If the forecast leads the MACD cross (forecast crosses before the current MACD does), it’s an early warning.
Use caution: forecasts are prone to false signals; always confirm.
Common trading setups using this indicator
Conservative:
Wait for MACD to cross signal + histogram above zero + forecast already trending same direction.
Use stop below recent swing low (for long) or above recent swing high (for short).
Aggressive (early entry):
Enter when forecast turns positive while MACD still below signal (anticipating cross).
Use tighter stops and smaller position sizes.
Exit rules:
Opposite MACD cross, histogram flipping sign, or a target based on risk-reward.
Use trailing stop based on ATR or structure.
Example settings for different timeframes (starting points)
Scalping / 5–15 min:
Fast 8, Slow 21, Signal 5, Forecast 1–2
Intraday / 1H:
Fast 12, Slow 26, Signal 9, Forecast 2–3
Swing / 4H–Daily:
Fast 12, Slow 26, Signal 9, Forecast 3–5 Adjust based on the asset volatility and backtests.
Adding alerts (TradingView)
Click the “Alerts” button (clock icon) or press Alt + A.
In the Condition dropdown, select the indicator name (able_macd_forecast) and choose a plotted series or built-in alert condition (if the script uses alertcondition).
Common alert types:
MACD crosses Signal (Crossing)
Histogram crosses 0 (Crossing)
Forecast crosses 0 or Forecast trend change (if provided)
Message templates:
“{{ticker}}: MACD crossed above signal on {{interval}}”
“{{ticker}} Forecast positive: MACD forecast shows upward momentum”
Customize the message for your trade automation or notifications.
Configure frequency (Only once, Once per bar, or Once per bar close) — for signals like crossovers, “Once per bar close” is usually safer to avoid repainting issues. Note: If the script includes alertcondition() calls with explicit IDs/messages, use those directly — they are the most reliable for automation.
Backtesting / Strategy conversion
If this script is a study (indicator), you can:
Convert it to a strategy by adding strategy.* order calls (strategy.entry, strategy.close) using the entry/exit logic you prefer, or
Use TradingView’s “Bar Replay” to manually test signals across different markets/timeframes.
If you want, I can help convert or write a strategy wrapper that uses the indicator’s signals to place backtest trades (I’ll need the code).
Practical tips & best practices
Use higher timeframe confirmation for lower-timeframe entries (e.g., check daily MACD momentum before trading 15m signals).
Beware of choppy markets; MACD / forecast may produce whipsaws. Combine with trend filters (moving average direction, ADX).
If you rely on forecasted values, prefer alerts “on bar close” when possible to reduce false alerts from intra-bar noise.
Tune parameters for the specific asset (FX, crypto, stocks have different behavior).
Record each signal and outcome for a sample period (20–100 trades) to evaluate performance.
Troubleshooting
Indicator won’t add: verify Pine version in script header (//@version=4 or //@version=5). TradingView may reject scripts with unsupported version syntax.
Plots missing: check script inputs (Some scripts hide plots if toggles are off).
Alerts firing too often: change alert frequency to “Once per bar close” or adjust threshold values.
Forecast seems to repaint: some forecast methods can repaint (use “bar_index” or store values only on closed bars, or use non-repainting forecast methods). Ask me to inspect the script for repainting logic.
What I can do next (recommended)
If you paste the content of able_macd_forecast.pine here, I will:
Produce a precise, line-by-line usage guide mapping to the exact input names and default values.
Show the exact plotted series names and how to reference them for alerts.
Point out any repainting risks and suggest fixes.
Provide example alert messages that match the script’s alertcondition IDs (if any).
Optionally convert it into a strategy for backtesting, or add non-repainting forecast logic if needed.
Float Rotation TrackerFloat Rotation Tracker - Quick Reference Guide
What is Float Rotation?
Float Rotation = Cumulative Daily Volume ÷ Float
Example:
Float = 5,000,000 shares
Day Volume = 7,500,000 shares
Rotation = 7.5M ÷ 5M = 1.5x (150%)
When rotation hits 1x (100%), every available share has theoretically changed hands at least once during the trading day.
Why It Matters
RotationMeaningImplication0.5x50% of float tradedInterest building1.0x 🔥Full rotationExtreme interest confirmed2.0x 🔥🔥Double rotationVery high volatility3.0x 🔥🔥🔥Triple rotationRare - maximum volatility
Key insight: High rotation on a low-float stock = explosive potential
Float Classification
Float SizeClassificationRotation Impact≤ 2M🔥 MICROExtremely volatile, fast rotation≤ 5M🔥 VERY LOWExcellent momentum potential≤ 10MLOWGood for rotation plays> 10MNORMALNeeds massive volume to rotate
Rule of thumb: Focus on stocks with float under 10M for meaningful rotation signals.
Reading the Indicator
Rotation Line (Yellow)
Shows current rotation level
Rises throughout the day as volume accumulates
Crosses horizontal level lines at milestones
Level Lines
LineColorMeaning0.5Gray dotted50% rotation1.0Orange solidFull rotation2.0Red solidDouble rotation3.0Fuchsia solidTriple rotation
Volume Bars (Bottom)
ColorMeaningGrayBelow average volumeBlueNormal volume (1-2x avg)GreenHigh volume (2-5x avg)LimeExtreme volume (5x+ avg)
Milestone Markers
Circles appear when rotation crosses key levels
Labels show "50%", "1x", "2x", "3x🔥"
Background Color
Changes as rotation increases
Darker = higher rotation level
Info Table Explained
FieldDescriptionFloatShare count + classification (MICRO/LOW/NORMAL)SourceAuto ✓ = TradingView data / Manual = user enteredRotationCurrent rotation with emoji indicatorRotation %Same as rotation × 100Day VolumeCumulative volume todayTo XxVolume needed to reach next milestoneBar RVolCurrent bar's relative volumeMilestonesWhich levels have been hit todayPer RotationShares equal to one full rotationEst. TimeBars until next milestone (at current pace)
Trading with Float Rotation
Entry Signals
Early Entry (Higher Risk, Higher Reward)
Rotation approaching 0.5x
Strong price action (bull flag, breakout)
Rising relative volume bars
Confirmation Entry (Lower Risk)
Rotation at or above 1x
Price holding above VWAP
Continuous green/lime volume bars
Late Entry (Highest Risk)
Rotation above 2x
Only enter on clear pullback pattern
Tight stop required
Exit Signals
Warning Signs:
Rotation very high (2x+) with declining volume bars
Reversal candle after milestone
Price breaking below key support
Volume bars turning gray/blue after being green/lime
Take Profits:
Partial profit at each rotation milestone
Trail stop as rotation increases
Full exit on reversal pattern after 2x+ rotation
Best Setups
Ideal Float Rotation Play
✓ Float under 10M (preferably under 5M)
✓ Stock up 5%+ on the day
✓ News catalyst driving interest
✓ Rotation approaching or exceeding 1x
✓ Price above VWAP
✓ Volume bars green or lime
✓ Clear chart pattern (bull flag, flat top)
Red Flags to Avoid
✗ Float over 50M (hard to rotate meaningfully)
✗ Rotation high but price declining
✗ Volume bars turning gray after spike
✗ No clear catalyst
✗ Price below VWAP with high rotation
✗ Late in day (3pm+) after 2x rotation
Float Data Sources
If auto-detect doesn't work, get float from:
SourceHow to FindFinvizfinviz.com → ticker → "Shs Float"Yahoo FinanceFinance.yahoo.com → Statistics → "Float"MarketWatchMarketwatch.com → ticker → ProfileYour BrokerUsually in stock details/fundamentals
Note: Float can change due to offerings, buybacks, lockup expirations. Check recent data.
Settings Guide
Conservative Settings
Alert Level 1: 0.75 (75%)
Alert Level 2: 1.0 (100%)
Alert Level 3: 2.0 (200%)
Alert Level 4: 3.0 (300%)
High Vol Multiplier: 2.0
Extreme Vol Multiplier: 5.0
Aggressive Settings
Alert Level 1: 0.3 (30%)
Alert Level 2: 0.5 (50%)
Alert Level 3: 1.0 (100%)
Alert Level 4: 2.0 (200%)
High Vol Multiplier: 1.5
Extreme Vol Multiplier: 3.0
Alert Setup
Recommended Alerts
100% Rotation (1x) - Primary signal
Most important milestone
Confirms extreme interest
High Rotation + Extreme Volume
Combined condition
Very high probability signal
How to Set
Right-click chart → Add Alert
Condition: Float Rotation Tracker
Select desired milestone
Set notification (popup/email/phone)
Set expiration
Common Questions
Q: Why is my float showing "Manual (no data)"?
A: TradingView doesn't have float data for this stock. Enter the float manually in settings after looking it up on Finviz or Yahoo Finance.
Q: The rotation seems too high/low - is the float wrong?
A: Possibly. Cross-check float on Finviz. Recent offerings or share structure changes may not be reflected in TradingView's data.
Q: What if float rotates early in the day?
A: Early 1x rotation (within first hour) is very bullish - indicates massive interest. Watch for continuation patterns.
Q: High rotation but price is dropping?
A: This is distribution - large holders are selling into demand. High rotation doesn't guarantee price direction, just volatility.
Q: Can I use this for swing trading?
A: The indicator resets daily, so it's designed for intraday use. You could note multi-day rotation patterns manually.
Quick Decision Matrix
RotationPrice ActionVolumeDecision<0.5xStrong upHighWatch, early stage0.5-1xConsolidatingSteadyPrepare entry1x+Breaking outIncreasingEntry on pattern1x+DroppingHighAvoid - distribution2x+Strong upExtremePartial profit, trail stop2x+Reversal candleDecliningExit or avoid
Workflow Integration
MORNING ROUTINE:
1. Scan for gappers (5%+, high volume)
2. Check float on each candidate
3. Apply Float Rotation Tracker
4. Prioritize lowest float with building rotation
DURING SESSION:
5. Watch rotation levels on active trades
6. Enter on patterns when rotation confirms (0.5-1x)
7. Scale out as rotation increases
8. Exit or trail after 2x rotation
END OF DAY:
9. Note which stocks hit 2x+ rotation
10. Review rotation vs price action
11. Learn patterns for future trades
Combining with Other Indicators
IndicatorHow to Use Together5 PillarsScreen for low-float stocks firstGap & GoCheck rotation on gappersBull FlagEnter bull flags with 1x+ rotationVWAPOnly trade rotation plays above VWAPRSIWatch for divergence at high rotation
Key Takeaways
Float size matters - Lower float = faster rotation = more volatility
1x is the key level - Full rotation confirms extreme interest
Volume quality matters - Green/lime bars better than gray
Combine with price action - Rotation confirms, patterns trigger
Know when you're late - 2x+ rotation is late stage
Check your float data - Wrong float = wrong rotation calculation
Happy Trading! 🔥
bows//@version=5
indicator("NQ EMA+RSI+ATR Alerts with SL/TP", overlay=true, shorttitle="NQ Alerts SLTP")
// === Inputs ===a
fastLen = input.int(9, "Fast EMA", minval=1)
slowLen = input.int(21, "Slow EMA", minval=1)
rsiLen = input.int(14, "RSI Length", minval=1)
rsiLongMax = input.int(70, "Max RSI to allow LONG", minval=50, maxval=90)
rsiShortMin = input.int(30, "Min RSI to allow SHORT", minval=10, maxval=50)
atrLen = input.int(14, "ATR Length", minval=1)
atrMultSL = input.float(1.5, "ATR Stop-Loss Multiplier", step=0.1)
atrMultTP = input.float(2.5, "ATR Take-Profit Multiplier", step=0.1)
// === Indicator calculations ===
price = close
fastEMA = ta.ema(price, fastLen)
slowEMA = ta.ema(price, slowLen)
rsiVal = ta.rsi(price, rsiLen)
atr = ta.atr(atrLen)
// === Entry signals ===
longSignal = ta.crossover(fastEMA, slowEMA) and rsiVal < rsiLongMax
shortSignal = ta.crossunder(fastEMA, slowEMA) and rsiVal > rsiShortMin
// === SL/TP Levels ===
longSL = price - atr * atrMultSL
longTP = price + atr * atrMultTP
shortSL = price + atr * atrMultSL
shortTP = price - atr * atrMultTP
// === Plotting ===
plot(fastEMA, color=color.orange, title="Fast EMA")
plot(slowEMA, color=color.blue, title="Slow EMA")
plotshape(longSignal, title="Buy Signal", style=shape.triangleup, color=color.new(color.green, 0), location=location.belowbar, size=size.tiny)
plotshape(shortSignal, title="Sell Signal", style=shape.triangledown, color=color.new(color.red, 0), location=location.abovebar, size=size.tiny)
// Optional visualization of SL/TP
plot(longSignal ? longSL : na, "Long Stop-Loss", color=color.new(color.red, 50), style=plot.style_linebr)
plot(longSignal ? longTP : na, "Long Take-Profit", color=color.new(color.green, 50), style=plot.style_linebr)
plot(shortSignal ? shortSL : na, "Short Stop-Loss", color=color.new(color.red, 50), style=plot.style_linebr)
plot(shortSignal ? shortTP : na, "Short Take-Profit", color=color.new(color.green, 50), style=plot.style_linebr)
// === Alerts with SL/TP info ===
alertcondition(longSignal, title="BUY Signal",
message="BUY Alert — NQ LONG: Entry @ {{close}} | SL: {{plot_1}} | TP: {{plot_2}} | {{ticker}}")
alertcondition(shortSignal, title="SELL Signal",
message="SELL Alert — NQ SHORT: Entry @ {{close}} | SL: {{plot_3}} | TP: {{plot_4}} | {{ticker}}")
// === Visual labels ===
if (longSignal)
label.new(bar_index, low, "BUY\nSL: " + str.tostring(longSL, format.mintick) + "\nTP: " + str.tostring(longTP, format.mintick),
style=label.style_label_up, color=color.new(#be14c4, 0), textcolor=color.white)
if (shortSignal)
label.new(bar_index, high, "SELL\nSL: " + str.tostring(shortSL, format.mintick) + "\nTP: " + str.tostring(shortTP, format.mintick),
style=label.style_label_down, color=color.new(color.red, 0), textcolor=color.white)
Probabilistic Panel - COMPLETE VERSION📘 Probabilistic Panel — User Manual
________________________________________
INTRODUCTION
The Probabilistic Panel is an advanced TradingView indicator that merges multiple technical-analysis components to provide a probabilistic evaluation of market direction. It is composed of several sections that assess trend, volume, price zones, support and resistance, multiple timeframes, and candle distribution.
________________________________________
PANEL STRUCTURE
1. HEADER
• PROBABILISTIC PANEL: Indicator name.
• FULL VERSION: Indicates that all functionalities are enabled.
________________________________________
2. GENERAL INFORMATION
• ASSET: Displays the asset symbol being analyzed.
• LIMITS: Shows score thresholds for classifying setups (A+, B, C).
________________________________________
3. DIRECTION PROBABILITIES
• PROB: Displays probability of upward movement (upPct) and downward movement (downPct) in percentage.
o Importance: Indicates the direction with the highest probability based on weighted factors.
________________________________________
4. CONTINUATION BIAS
• BIAS: Shows the probability of continuation of the current trend (intrProbCont).
o Importance: Evaluates whether the market is likely to continue in the same direction.
________________________________________
5. MULTI-TIMEFRAME ANALYSIS (MTF)
• MTF: Shows trend direction across multiple timeframes (1D, 1H, 15M, 5M, 1M) using arrows (↑ uptrend, ↓ downtrend, → sideways).
o Importance: Helps identify convergence or divergence between timeframes.
• ALIGNED MTF: Displays the percentage of alignment between timeframes.
o Importance: Higher alignment indicates stronger trends.
________________________________________
6. VOLUME
• VOLUME: Indicates whether volume is “INCREASING”, “DECREASING”, or “STABLE.”
o Importance: Increasing volume confirms trend strength.
________________________________________
7. TECHNICAL INDICATORS
• RSI/ROC: Displays RSI (Relative Strength Index) and ROC (Rate of Change).
o Importance:
RSI > 65 → Overbought
RSI < 35 → Oversold
ROC → Momentum strength indicator
________________________________________
8. PRICE ZONE
• ZONE: Classifies current price as “PREMIUM” (above average), “DISCOUNT” (below average), or “EQUILIBRIUM.”
o Importance: Helps identify buying/selling opportunities based on mean-reversion logic.
________________________________________
9. CANDLE ANALYSIS
• AMPLITUDE: Shows current candle size in percentage and ticks.
o Importance: Candles above minimum amplitude threshold are considered trade-valid.
• FORMATION: Classifies candle as:
o HIGH INDECISION
o TOP REJECTION
o BOTTOM REJECTION
o CONVICTION
o MIXED
o Importance: Reflects market sentiment and psychology.
• WICKS: Displays upper and lower wick size in percentage.
o Importance: Longer wicks suggest rejection or indecision.
• RATIO: Ratio between total wick size and candle body.
o Importance: High ratio = indecision; low ratio = conviction.
________________________________________
10. TRENDS
• AMPLITUDE TREND: Indicates if amplitude is “INCREASING,” “DECREASING,” or “STABLE.”
o Importance: Increasing amplitude may signal rising volatility.
• CONVICTION TREND: Indicates recent candle conviction:
o STRONG UP
o STRONG DOWN
o INDECISIVE
o MIXED
o Importance: Measures the strength of recent candles.
________________________________________
11. PROBABILITY DIFFERENCE (DIF PROB)
• Shows the percentage difference between upward and downward probabilities, classified as:
o EXCELLENT: Very favorable
o GOOD: Significant
o MEDIUM: Moderate (avoid entering)
o MARKET LOSING STRENGTH: Small difference (avoid entering)
o UNSTABLE MARKET: Very small difference (do not trade)
o Importance: Higher difference = more directional clarity.
________________________________________
12. CONFIRMATIONS
• Shows how many consecutive confirmations of the current signal were achieved relative to the configured requirement.
o Importance: More confirmations increase reliability.
________________________________________
13. SCORE & CLASSIFICATION
• SCORE: Final score from 0 to 100, calculated based on multiple factors.
o Higher scores = better setups.
• CLASSIFICATION: Setup categorized as:
o A+ SETUP
o B SETUP
o C SETUP
o DO NOT TRADE
o Importance: Defines whether conditions are favorable.
________________________________________
14. ACTION
• ACTION: Suggests “BUY,” “SELL,” or “WAIT.”
o Importance: Final actionable signal.
________________________________________
DECISION LOGIC
The indicator uses a weighted combination of multiple factors:
1. Trend (wTrend): Based on the price relative to EMA50.
2. Volume (wVol): Based on recent volume vs. its average.
3. Zone (wZona): Based on price position within recent price range.
4. Support/Resistance (wSR): Based on strength of S/R levels.
5. MTF (wMTF): Timeframe alignment.
6. Distribution (wDist): Distribution of bullish, bearish, and neutral candles.
The final score integrates:
• Probability of upward movement
• Continuation bias
• MTF conflict
• Moving-average alignment
• Volume
• Extreme RSI conditions
________________________________________
FALSE-SIGNAL FILTERS
• Close-Only Mode: Updates calculations only on candle close.
• Minimum Candle Size: Ignores very small candles.
• Consecutive Confirmations: Requires repeated signal confirmation.
• Minimum Probability Difference: Enforces a minimum separation between bullish and bearish probabilities.
________________________________________
CONCLUSION
The Probabilistic Panel is a comprehensive tool that integrates multiple technical-analysis dimensions to deliver more reliable trading signals. Parameters must be adjusted according to the asset and timeframe.
Remember: no indicator is infallible.
Always combine it with risk management and additional confirmations.






















