5SMA+B.B.+RSI//@version=5
indicator("5SMA+B.B.+RSI", overlay = true)
// SMAの各種設定
SMAEnable = input.bool(true, title = "SMA Enable", group = "SMA settings")
SMASource1 = input.source(close, title = "SMA1 Source")
SMALength1 = input.int(5, title = "SMA1 Length")
SMASource2 = input.source(close, title = "SMA2 Source")
SMALength2 = input.int(25, title = "SMA2 Length")
SMASource3 = input.source(close, title = "SMA3 Source")
SMALength3 = input.int(75, title = "SMA3 Length")
SMASource4 = input.source(close, title = "SMA4 Source")
SMALength4 = input.int(100, title = "SMA4 Length")
SMASource5 = input.source(close, title = "SMA5 Source")
SMALength5 = input.int(150, title = "SMA5 Length")
// Bollinger Bandの各種設定
BBEnable = input.bool(true, title = "Bollinger Band Enable", group = "B.B. settings")
BBSource = input.source(close, title = "BB Source")
BBLength = input.int(20, title = "BB Length")
BBDeviation = input.float(2.0, title = "BB 偏差")
// RSIの各種設定
RSIEnable = input.bool(true, title = "RSI Enable", group = "RSI settings")
RSISource = input.source(close, title = "RSI Source")
RSILength = input.int(14, title = "RSI Length")
RSIUpper = input.float(70.0, title = "RSI Upper level")
RSILower = input.float(30.0, title = "RSI Lower level")
// SMAの算出
SMA1 = ta.sma(SMASource1, SMALength1)
SMA2 = ta.sma(SMASource2, SMALength2)
SMA3 = ta.sma(SMASource3, SMALength3)
SMA4 = ta.sma(SMASource4, SMALength4)
SMA5 = ta.sma(SMASource5, SMALength5)
// Bollinger Bandの算出
BBSMA = ta.sma(BBSource, BBLength)
BBDev = ta.stdev(BBSource, BBLength)
BBUpper = BBSMA + BBDeviation * BBDev
BBLower = BBSMA - BBDeviation * BBDev
// RSIの算出
RSIValue = ta.rsi(RSISource, RSILength)
// プロット
plot(SMAEnable ? SMA1 : na, title = "SMA1", linewidth = 2, color = color.white)
plot(SMAEnable ? SMA2 : na, title = "SMA2", linewidth = 2, color = color.blue)
plot(SMAEnable ? SMA3 : na, title = "SMA3", linewidth = 2, color = color.yellow)
plot(SMAEnable ? SMA4 : na, title = "SMA4", linewidth = 2, color = color.green)
plot(SMAEnable ? SMA5 : na, title = "SMA5", linewidth = 2, color = color.gray)
plot(BBEnable ? BBSMA : na, title = "BB SMA", color = color.orange)
plot(BBEnable ? BBUpper : na, title = "BB Upper", color = color.orange)
plot(BBEnable ? BBLower : na, title = "BB Lower", color = color.orange)
plotshape(RSIEnable and RSIUpper < RSIValue, style = shape.triangleup, location = location.abovebar, color = color.white, display = display.pane)
plotshape(RSIEnable and RSIValue < RSILower, style = shape.triangledown, location = location.belowbar, color = color.white, display = display.pane)//@version=5
indicator("5SMA+B.B.+RSI", overlay = true)
// SMAの各種設定
SMAEnable = input.bool(true, title = "SMA Enable", group = "SMA settings")
SMASource1 = input.source(close, title = "SMA1 Source")
SMALength1 = input.int(5, title = "SMA1 Length")
SMASource2 = input.source(close, title = "SMA2 Source")
SMALength2 = input.int(25, title = "SMA2 Length")
SMASource3 = input.source(close, title = "SMA3 Source")
SMALength3 = input.int(75, title = "SMA3 Length")
SMASource4 = input.source(close, title = "SMA4 Source")
SMALength4 = input.int(100, title = "SMA4 Length")
SMASource5 = input.source(close, title = "SMA5 Source")
SMALength5 = input.int(150, title = "SMA5 Length")
// Bollinger Bandの各種設定
BBEnable = input.bool(true, title = "Bollinger Band Enable", group = "B.B. settings")
BBSource = input.source(close, title = "BB Source")
BBLength = input.int(20, title = "BB Length")
BBDeviation = input.float(2.0, title = "BB 偏差")
// RSIの各種設定
RSIEnable = input.bool(true, title = "RSI Enable", group = "RSI settings")
RSISource = input.source(close, title = "RSI Source")
RSILength = input.int(14, title = "RSI Length")
RSIUpper = input.float(70.0, title = "RSI Upper level")
RSILower = input.float(30.0, title = "RSI Lower level")
// SMAの算出
SMA1 = ta.sma(SMASource1, SMALength1)
SMA2 = ta.sma(SMASource2, SMALength2)
SMA3 = ta.sma(SMASource3, SMALength3)
SMA4 = ta.sma(SMASource4, SMALength4)
SMA5 = ta.sma(SMASource5, SMALength5)
// Bollinger Bandの算出
BBSMA = ta.sma(BBSource, BBLength)
BBDev = ta.stdev(BBSource, BBLength)
BBUpper = BBSMA + BBDeviation * BBDev
BBLower = BBSMA - BBDeviation * BBDev
// RSIの算出
RSIValue = ta.rsi(RSISource, RSILength)
// プロット
plot(SMAEnable ? SMA1 : na, title = "SMA1", linewidth = 2, color = color.white)
plot(SMAEnable ? SMA2 : na, title = "SMA2", linewidth = 2, color = color.blue)
plot(SMAEnable ? SMA3 : na, title = "SMA3", linewidth = 2, color = color.yellow)
plot(SMAEnable ? SMA4 : na, title = "SMA4", linewidth = 2, color = color.green)
plot(SMAEnable ? SMA5 : na, title = "SMA5", linewidth = 2, color = color.gray)
plot(BBEnable ? BBSMA : na, title = "BB SMA", color = color.orange)
plot(BBEnable ? BBUpper : na, title = "BB Upper", color = color.orange)
plot(BBEnable ? BBLower : na, title = "BB Lower", color = color.orange)
plotshape(RSIEnable and RSIUpper < RSIValue, style = shape.triangleup, location = location.abovebar, color = color.white, display = display.pane)
plotshape(RSIEnable and RSIValue < RSILower, style = shape.triangledown, location = location.belowbar, color = color.white, display = display.pane)
Penunjuk dan strategi
Ocean's PVSRAList of features:
PVSRA Candles
Vector Candle Zones
PVSRA POCs
5/13/20/50/100/200/800 EMAs
2 Custom EMAs
13/50/200 Daily EMAs
Pivot points (S/M/R 1,2,3; PP )
Daily Open
Psychological High/Low
All of these are configurable in the indicator settings.
Usage instructions:
PVSRA Candle colors meaning:
Green (bull) and red (bear): Candles with volume >= 200% of the average volume of the 10 previous chart candles, and candles where the product of candle spread x candle volume is >= the highest for the 10 previous chart time candles.
Blue (bull) and blue-violet (bear): Candles with volume >= 150% of the average volume of the 10 previous chart candles
Vector Candle Zones:
displays unrecovered liquidity left behind on unrecovered vectors.
PVSRA POCs:
Display the POC of High Volume Candles.
EMA/Pivot Points:
- EMA retrace: Breaking these in either direction without addressing an imbalance on the opposite side requires confirmation after the break.
- Pivot-level trading operates on the same principle.
- **Note:** Pivot levels in this indicator have additional M-levels, which represent 50% markers to provide better insights into potential retraces or upward moves.
- For example: Breaking M1, retracing, and confirming at M1 with a target at M2.
Daily Open:
The daily open helps identify possible SPOT/Futures gaps (depending on the asset, such as a missing futures market over the weekend: NAS/DAX). Can display historical values too.
Psychological High/Low:
Configurable for Crypto or Forex - draws the perceived Psychological High/Low ranges for the week. Can display historical values too.
Trend Strength Gauge sam//@version=6
indicator("Trend Strength Gauge", overlay=true)
// Input for indicators
lengthMA = input.int(50, title="Moving Average Length")
lengthATR = input.int(14, title="ATR Length")
lengthRSI = input.int(14, title="RSI Length")
rsiOverbought = input.int(70, title="RSI Overbought Level")
rsiOversold = input.int(30, title="RSI Oversold Level")
// Calculating Moving Averages
maShort = ta.sma(close, lengthMA)
maLong = ta.sma(close, lengthMA * 2) // Using a longer period for trend confirmation
// Calculating ATR for volatility
atrValue = ta.atr(lengthATR)
// Calculating RSI for momentum
rsiValue = ta.rsi(close, lengthRSI)
// Trend Strength Calculation
trendDirection = maShort > maLong ? 1 : -1
volatilityFactor = atrValue / close
momentumFactor = rsiValue > rsiOverbought ? -1 : (rsiValue < rsiOversold ? 1 : 0)
// Trend Strength Formula (0 to 100)
strength = (trendDirection * 50 + volatilityFactor * 50 + momentumFactor * 50)
// Normalize strength to be between 0 and 100
strength := math.min(math.max(strength, 0), 100)
// Plot the Trend Strength Gauge as a histogram
plot(strength, title="Trend Strength", color=color.new(color.blue, 0), linewidth=2, style=plot.style_histogram)
// Color the background based on trend strength
bgcolor(strength > 70 ? color.new(color.green, 90) : (strength < 30 ? color.new(color.red, 90) : na))
// Plot the moving averages on the chart for reference
plot(maShort, title="Short MA", color=color.green, linewidth=2)
plot(maLong, title="Long MA", color=color.red, linewidth=2)
Ocean's RSIOverview
The Ocean's RSI+ is a custom implementation of the Relative Strength Index (RSI) designed to provide traders with additional insight into market conditions. It builds upon the traditional RSI by introducing custom thresholds, visual bands, and annotations, making it easier to interpret overbought and oversold conditions, potential reversals, and periods of market neutrality.
This indicator is intended to help traders identify optimal entry and exit points by analyzing price momentum and strength across predefined levels.
How to Use the Indicator
1. Identifying Market Momentum
Observe the RSI line:
When it trends above 62, the market is likely in a strong uptrend or overbought condition.
When it trends below 24, the market is likely in a downtrend or oversold condition.
2. Trading Decisions Based on Zones
Strong Buy Zone (RSI < 16):
Indicates extreme oversold conditions.
Look for reversal patterns and consider entering a long position.
Possible Reversal Zone (RSI 24-38):
Market may reverse upward soon.
Watch for confirmation of bullish momentum.
Neutral Zone (RSI 38-50):
Market is consolidating; avoid entering large positions.
Prepare for potential trend continuation or reversal.
Possible Retrace Zone (RSI 50-62):
Indicates potential for a slight retracement.
Observe price action for continuation or reversal signals.
Strong Sell Zone (RSI > 62):
Indicates high momentum; market may be overbought.
Look for bearish patterns and consider exiting or shorting.
Upper Band Zone (RSI > 80):
Extreme overbought conditions.
Market is at high risk of reversal; consider taking profits.
3. Color Shading as Visual Cues
Use the colored bands to quickly assess the market’s state:
Red: Caution, overbought levels.
Green: Potential trade opportunities.
Blue: Caution, oversold levels.
4. Confirmation with Other Indicators
Combine Ocean's RSI+ with other indicators (e.g., moving averages, MACD, or volume) for confirmation of trends and reversals.
Use price action and candlestick patterns to validate entries and exits.
Bullish & Bearish Candles with Bollinger BandsI have created pine script for tradingview. in this script I have been focus candlestick with bollinger band.
Gate by Sanskaaarema 20,50,100,200
Identify trends: By observing the direction and spacing of the EMAs.
Find potential support and resistance levels: The EMAs themselves and the filled areas between them can act as dynamic support/resistance.
Get crossover signals (with alerts): The example alerts show how to be notified of price crossing specific EMAs.
Keep the chart clean: The user-selectable EMAs allow for decluttering.
ADX + RSI + EMA Trading Strategy Thulasian indicator that specifically identifies low volatility or ranging conditions. One of the best indicators for this purpose is the Average Directional Index (ADX). Here's how you can use it to avoid sideways markets and trade only during trending conditions:
ORB by VJRange Breakout Indicator (RBI) – High-Probability Trading Tool
The Range Breakout Indicator (RBI) is a powerful trading tool designed to identify high-probability breakout opportunities with a winning accuracy of over 90%. This indicator analyzes price consolidation zones, detects key breakout levels, and confirms momentum shifts to maximize profitability.
Key Features:
✅ Breakout Confirmation: Detects valid breakouts beyond a defined range, reducing false signals.
✅ Smart Volatility Filter: Ensures breakouts occur with sufficient momentum for sustained price movement.
✅ Trend Bias Detection: Aligns breakouts with the prevailing trend for higher success rates.
✅ Risk Management Alerts: Provides optimal stop-loss and take-profit levels for secure trading.
✅ Multi-Timeframe Analysis: Enhances accuracy by filtering signals across different timeframes.
Ideal for intraday and swing traders, the RBI helps capitalize on market breakouts with exceptional accuracy, ensuring traders stay ahead of major price movements. 🚀📈
3 Min Chart with 15 Min ST & SMAThis indicator combines multiple technical analysis tools on a 3-minute chart to provide potential trading signals. It displays:
* **15-Minute Supertrend (ST):** Two Supertrend indicators are plotted - one calculated on the 3-minute chart itself, and another calculated on the 15-minute chart. The 15-minute Supertrend is displayed on the 3-minute chart using `request.security` to provide a broader trend context. Supertrend helps identify potential trend reversals or continuations.
* **15-Period Simple Moving Average (SMA):** A 15-period SMA is plotted to visualize the average closing price over the last 15 periods.
* **200-Period Exponential Moving Average (EMA):** A 200-period EMA is plotted to identify the long-term trend.
* **Trading Signal:** The indicator generates a simple trading signal based on the confluence of the Supertrend and SMA:
* **Buy on Dip:** Occurs when the 3-minute Supertrend is bullish, the 15-minute Supertrend is bullish, and the price is above the 15 SMA.
* **Sell on Rise:** Occurs when the 3-minute Supertrend is bearish, the 15-minute Supertrend is bearish, and the price is below the 15 SMA.
* **Neutral:** Occurs when the above conditions aren't met.
* **Table Display:** A table summarizes the current status of:
* The 3-minute Supertrend
* The 15-minute Supertrend
* Price relative to the 15 SMA.
* **Candle Body Percentage:** The indicator uses candle body percentage to refine the signals and only generates signals when the candle's body is greater than 40%.
* **Higher High/Higher Low:** The indicator identifies Higher High/Lower Low patterns to potentially enhance signal reliability.
**How to Use:**
* Use the signals as potential entry points.
* Consider other indicators and market analysis to confirm signals.
* Use the table to quickly assess the key trend and signal components.
* Backtest the indicator on historical data to determine optimal parameters for your trading style.
**Important Considerations:**
* This indicator is a tool and does not guarantee profits.
* Market conditions can change, and signals may become inaccurate.
* Always use risk management techniques (stop-loss orders, position sizing).
* Optimize the parameters (e.g., Supertrend factors, SMA length) to suit the specific asset you are trading and your trading timeframe.
Power Law Below is a detailed, line-by-line explanation in English of the Pine Script (TradingView) code. It uses Pine Script v6 syntax.
---
```pine
//@version=6
indicator("Power Law", overlay=true)
```
1. `//@version=6`
- Declares that this script uses Pine Script version 6. It must appear on the very first line.
2. `indicator("Power Law", overlay=true)`
- Defines this script as an indicator named **"Power Law"**.
- `overlay=true` means this indicator is plotted on the main chart (the price chart) rather than in a separate pane.
---
```pine
// Days X-Axis Value
start = time == timestamp(2010, 7, 18, 0, 0)
days = request.security("INDEX:BTCUSD", 'D', ta.barssince(start))
offset = 561 // days between 2009/1/1 and "start"
d = days + offset
```
1. `start = time == timestamp(2010, 7, 18, 0, 0)`
- Checks if the current bar’s `time` equals July 18, 2010 at 00:00. This returns a boolean value (`true` or `false`).
- It’s mainly used together with `ta.barssince(start)` to calculate the number of bars elapsed since this “start” date.
2. `days = request.security("INDEX:BTCUSD", 'D', ta.barssince(start))`
- `request.security()` lets the script request data from another symbol or another timeframe—in this case, `"INDEX:BTCUSD"` on the Daily (`'D'`) timeframe.
- The third argument, `ta.barssince(start)`, is a built-in function in Pine that counts how many bars have passed since `start` was `true`. In this script, it effectively measures how many daily bars have elapsed since July 18, 2010.
- The result is assigned to `days`, indicating “the count of daily bars between July 18, 2010 and the most recent daily bar in the BTC index.”
3. `offset = 561`
- A user-defined number. The comment states it’s the number of days between January 1, 2009, and the “start” date (July 18, 2010). It is used to calibrate or shift the day count.
4. `d = days + offset`
- Adds the offset to `days`, giving a final day-count-like value (`d`) that the script uses later in the power-law calculations.
---
```pine
a = input(-17.668, "Power Law Intercept", group="Power Law Settings")
b = input(5.926, "Power Law Slope", group="Power Law Settings")
```
- These lines define two adjustable parameters `a` and `b` using `input()`, making them editable via the indicator’s settings.
- `a` (the intercept) is labeled “Power Law Intercept.”
- `b` (the slope) is labeled “Power Law Slope.”
- `group="Power Law Settings"` puts them into a named group in the settings dialog.
---
```pine
price_power_law_0 = math.pow(10, a + b*math.log10(d))
price_power_law_1 = math.pow(10, a + b*math.log10(d + 1*365))
price_power_law_2 = math.pow(10, a + b*math.log10(d + 2*365))
price_power_law_3 = math.pow(10, a + b*math.log10(d + 3*365))
price_power_law_4 = math.pow(10, a + b*math.log10(d + 4*365))
price_power_law_5 = math.pow(10, a + b*math.log10(d + 5*365))
```
- These lines each calculate a “power law” price value:
\
- `d` is the base day count.
- `math.log10(...)` takes the base-10 logarithm.
- `a` is the intercept; `b` is the slope in the power-law model.
- Adding `(1*365), (2*365), ...` to `d` suggests forecasts or curves 1 year, 2 years, etc. beyond the baseline.
- `math.pow(10, ... )` is simply 10 raised to the power of `(a + b * log10(...))`.
---
```pine
// Use a valid 6-digit color code (e.g. #FFFFAA) or 8-digit (e.g. #FFFFAA80)
p0 = plot(price_power_law_0, color=#FFFFAA, title="Power Law", linewidth=1)
p1 = plot(price_power_law_1, title="Power Law 1", linewidth=1, color=bar_index % 2 == 0 ? #FFFFAA : #000000)
p2 = plot(price_power_law_2, title="Power Law 2", linewidth=1, color=bar_index % 2 == 0 ? #FFFFAA : #000000)
p3 = plot(price_power_law_3, title="Power Law 3", linewidth=1, color=bar_index % 2 == 0 ? #FFFFAA : #000000)
p4 = plot(price_power_law_4, title="Power Law 4", linewidth=1, color=bar_index % 2 == 0 ? #FFFFAA : #000000)
p5 = plot(price_power_law_5, title="Power Law 5", linewidth=1, color=bar_index % 2 == 0 ? #FFFFAA : #000000)
```
1. The script plots six lines (from `price_power_law_0` to `price_power_law_5`).
2. `color=#FFFFAA`
- A 6-digit hex color (`#RRGGBB`) that sets the line’s color.
3. `color=bar_index % 2 == 0 ? #FFFFAA : #000000`
- A conditional color assignment: if `bar_index % 2 == 0`, the color is `#FFFFAA`, otherwise it is `#000000`. This makes line colors alternate depending on the bar index.
4. `linewidth=1` sets the thickness of each line.
5. `title="Power Law X"` sets each line’s label in the chart’s legend.
---
## How It Works
- The script calculates how many daily bars have passed since July 18, 2010 (plus a manual offset of 561 days).
- It then applies a power-law formula for various offsets (`+ 1*365`, etc.), each representing a different curve.
- Finally, it plots these six curves on the main chart, showing potential price trajectories or “power-law” relationships for Bitcoin’s historical data (taken from `"INDEX:BTCUSD"` on a daily timeframe).
## Important Notes
1. **Color Codes**
- Must be valid 6-digit or 8-digit hex codes (e.g. `#FFFFAA` or `#FFFFAA80`). Otherwise, you’ll get a syntax error.
2. **`request.security()`**
- Fetching data from `"INDEX:BTCUSD"` on a daily timeframe. If your chart is on another symbol or timeframe, the script still references the daily bars from that index, which can lead to alignment differences.
3. **Logarithms**
- Make sure `d` (or `d + n*365`) never becomes zero or negative, otherwise `math.log10()` will fail. If your script tries to log10(0) or a negative number, you’ll get an error.
4. **Conceptual Use**
- This script’s logic is specific to modeling Bitcoin’s price over time using a power-law approach. You can change the `start` date, the offset, or the intercept/slope inputs to adapt the script for different data sources or fitting strategies.
---
**In summary,** this script draws several power-law curves on the chart based on a reference date (July 18, 2010) and an offset, presumably chosen to align with Bitcoin’s historical timeline. By adjusting `a` (the intercept) and `b` (the slope), you can fine-tune how these curves fit the historical data.
OSB + EMA Outside Bar Trading Strategy
Buy Setup:
1. Identify a bullish Outside Bar where the high and low exceed the previous candle’s range.
2. Enter a buy trade when price breaks above the high of the Outside Bar.
3. Set a stop-loss below the Outside Bar’s low.
4. Take profit at a key resistance level or use a trailing stop for extended gains.
Sell Setup:
1. Identify a bearish Outside Bar with a high and low exceeding the prior candle’s range.
2. Enter a sell trade when price breaks below the low of the Outside Bar.
3. Place a stop-loss above the Outside Bar’s high.
4. Take profit at a support level or use a trailing stop for further downside potential.
This strategy works best in trending markets and can be enhanced with confirmation from volume, moving averages, or support/resistance levels. 🚀
My scriptKey Enhancements:
Stop Loss and Take Profit:
We added inputs for Stop Loss and Take Profit percentages. You can modify these values as per your strategy. For example, if you set the Stop Loss to 1% and the Take Profit to 2%, the strategy will automatically place orders to close a position at those levels.
Exit Logic:
The strategy exits the long position either when the Change of Character occurs (bearish signal) or when the price hits the Stop Loss or Take Profit levels.
Plotting Levels:
We visually plot the Stop Loss and Take Profit levels on the chart to help you better understand where the strategy is placing these levels.
Strategy Performance:
By including exit conditions based on both Stop Loss and Take Profit, we can better assess the profitability of the strategy.
TradingView automatically calculates performance metrics such as Net Profit, Profit Factor, Win Rate, Drawdown, and others in the Strategy Tester panel.
How to Evaluate Profitability:
Apply the Script:
Copy the updated code into TradingView's Pine Script Editor and click Add to Chart.
View Performance Metrics:
After applying the strategy, click on the Strategy Tester tab below the chart.
In this tab, you will see various metrics such as Net Profit, Max Drawdown, Win Rate, Profit Factor, etc.
Optimize Parameters:
You can adjust the lookback, stopLossPct, and takeProfitPct parameters in the script to optimize the strategy for better profitability. You can use TradingView's built-in strategy optimization tools to backtest different combinations.
Interpret Results:
The Profit Factor measures how many dollars you earned for each dollar lost. A value greater than 1 indicates a profitable strategy.
The Win Rate indicates how often the strategy wins, while the Net Profit shows how much profit you made over the backtest period.
The Max Drawdown helps you understand the worst peak-to-trough loss during the backtest period.
Key Strategy Performance Metrics:
Net Profit: The total profit or loss generated by the strategy.
Profit Factor: The ratio of gross profit to gross loss. A profit factor above 1 indicates profitability.
Win Rate: The percentage of winning trades in the backtest.
Max Drawdown: The largest peak-to-trough loss, indicating the strategy's risk during a drawdown.
Example Adjustments:
You can fine-tune the strategy by adjusting parameters, such as:
Lookback Period: If the market is more volatile, you might reduce the lookback to identify structure changes more quickly.
Stop Loss/Take Profit: The Stop Loss and Take Profit levels can be adjusted based on your risk tolerance and market conditions.
Next Steps:
If you want to explore further, consider adding more advanced features, like:
Volume Analysis: Include volume to confirm the CoC (e.g., high volume on a reversal).
Time-of-day Filter: Trade only during certain hours when the market is more volatile.
Trend Confirmation: Use higher timeframe trend indicators to filter trades.
This enhanced version should give you a better understanding of the profitability and overall effectiveness of a Change of Character strategy based on Smart Money Concepts. Let me know if you'd like further refinements or help with interpreting the results!
BankNifty/Nifty Breakout StrategyHere is your TradingView Pine Script for the Nifty/Bank Nifty options breakout strategy. It includes CPR levels, VWAP, Supertrend, and RSI for signals. It also sets alerts for call and put buying conditions.
TradFi Fundamentals: Momentum Trading with Macroeconomic DataIntroduction
This indicator combines traditional price momentum with key macroeconomic data. By retrieving GDP, inflation, unemployment, and interest rates using security calls, the script automatically adapts to the latest economic data. The goal is to blend technical analysis with fundamental insights to generate a more robust momentum signal.
Original Research Paper by Mohit Apte, B. Tech Scholar, Department of Computer Science and Engineering, COEP Technological University, Pune, India
Link to paper
Explanation
Price Momentum Calculation:
The indicator computes price momentum as the percentage change in price over a configurable lookback period (default is 50 days). This raw momentum is then normalized using a rolling simple moving average and standard deviation over a defined period (default 200 days) to ensure comparability with the economic indicators.
Fetching and Normalizing Economic Data:
Instead of manually inputting economic values, the script uses TradingView’s security function to retrieve:
GDP from ticker "GDP"
Inflation (CPI) from ticker "USCCPI"
Unemployment rate from ticker "UNRATE"
Interest rates from ticker "USINTR"
Each series is normalized over a configurable normalization period (default 200 days) by subtracting its moving average and dividing by its standard deviation. This standardization converts each economic indicator into a z-score for direct integration into the momentum score.
Combined Momentum Score:
The normalized price momentum and economic indicators are each multiplied by user-defined weights (default: 50% price momentum, 20% GDP, and 10% each for inflation, unemployment, and interest rates). The weighted components are then summed to form a comprehensive momentum score. A horizontal zero line is plotted for reference.
Trading Signals:
Buy signals are generated when the combined momentum score crosses above zero, and sell signals occur when it crosses below zero. Visual markers are added to the chart to assist with trade timing, and alert conditions are provided for automated notifications.
Settings
Price Momentum Lookback: Defines the period (in days) used to compute the raw price momentum.
Normalization Period for Price Momentum: Sets the window over which the price momentum is normalized.
Normalization Period for Economic Data: Sets the window over which each macroeconomic series is normalized.
Weights: Adjust the influence of each component (price momentum, GDP, inflation, unemployment, and interest rate) on the overall momentum score.
Conclusion
This implementation leverages TradingView’s economic data feeds to integrate real-time macroeconomic data into a momentum trading strategy. By normalizing and weighting both technical and economic inputs, the indicator offers traders a more holistic view of market conditions. The enhanced momentum signal provides additional context to traditional momentum analysis, potentially leading to more informed trading decisions and improved risk management.
The next script I release will be an improved version of this that I have added my own flavor to, improving the signals.
Footprint IQ Pro [TradingIQ]Hello Traders!
Introducing "Footprint IQ Pro"!
Footprint IQ Pro is an all-in-one Footprint indicator with several unique features.
Features
Calculated delta at tick level
Calculated delta ratio at tick level
Calculated buy volume at tick level
Calculated sell volume at tick level
Imbalance detection
Stacked imbalance detection
Stacked imbalance alerts
Value area and POC detection
Highest +net delta levels detection
Lowest -net delta levels detection
CVD by tick levels
Customizable values area percentage
The image above thoroughly outlines what each metric in the delta boxes shows!
Metrics In Delta Boxes
"δ:", " δ%:", " ⧎: ", " ◭: ", " ⧩: "
δ Delta (Difference between buy and sell volume)
δ% Delta Ratio (Delta as a percentage of total volume)
⧎ Total Volume At Level (Total volume at the price area)
◭ Total Buy Volume At Level (Total buy volume at the price area)
⧩ Total Sell Volume At Level (total sell volume at the price area)
Each metric comes with a corresponding symbol.
That said, until you become comfortable with the symbol, you can also turn on the descriptive labels setting!
The image above exemplifies the feature.
The image above shows Footprint IQ's full power!
Additionally, traders with an upgraded TradingView plan can make use of the "1-Second" feature Footprint IQ offers!
The image above shows each footprint generated using 1-second volume data. 1-second data is highly granular compared to 1-minute data and, consequently, each footprint is exceptionally more accurate!
Imbalance Detection
Footprint IQ pro is capable of detecting user-defined delta imbalances.
The image above further explains how Footprint IQ detects imbalances!
The imbalance percentage is customizable in the settings, and is set to 70% by default.
Therefore,
When net delta is positive, and the positive net delta constitutes >=70% of the total volume, a buying imbalance will be detected (upwards triangle).
When net delta is negative, and the negative net delta constitutes >=70% of the total volume, a buying imbalance will be detected (downwards triangle).
Stacked Imbalance Detection
In addition to imbalance detection, Footprint IQ Pro can also detect stacked imbalances!
The image above shows Footprint IQ Pro detecting stacked imbalances!
Stacked imbalances occur when consecutive imbalances at sequential price areas occur. Stacked imbalances are generally interpreted as significant price moves that are supported by volume, rather than a significant result with disproportionate effort.
The criteria for stacked imbalance detection (how many imbalances must occur at sequential price areas) is customizable in the settings.
The default value is three. Therefore, when three imbalances occur at sequential price areas, golden triangles will begin to print to show a stacked imbalance.
Additionally, traders can set alerts for when stacked imbalances occur!
Highest +Delta and Highest -Delta Levels
In addition to being a fully-fledged Footprint indicator, Footprint IQ Pro goes one step further by detecting price areas where the greater +Delta and -Delta are!
The image above shows price behavior near highest +Delta price areas detected by Footprint IQ!
These +Delta levels are considered important as there has been strong interest from buyers at these price areas when they are traded at.
It's expected that these levels can function as support points that are supported by volume.
The image above shows a similar function for resistance points!
Blue lines = High +Delta Detected Price Areas
Red lines = High -Delta Detected Price Areas
Value Area Detection
Similar to traditional volume profile, Footprint IQ Pro displays the value area per bar.
Green lines next to each footprint show the value area for the bar. The value area % is customizable in the settings.
CVD Levels
Footprint IQ Pro is capable of storing historical volume delta information to provide CVD measurements at each price area!
The image above exemplifies this feature!
When this feature is enabled, you will see the CVD of each price area, rather than the net delta!
And that's it!
Thank you so much to TradingView for offering the greatest charting platform for everyone to create on!
If you have any feature requests you'd like to see for Footprint IQ, please feel free to share them with us!
Thank you!
Advanced Averaged Momentum Indicator (AAMI)Key Features of AAMI:
Combination of Momentum Indicators: It averages normalized values from RSI, MACD histogram, raw Momentum, and Stochastic oscillator to give a comprehensive view of momentum.
Normalization: Each component is normalized to a scale from -1 to 1 to ensure they contribute equally to the AMI calculation.
Visual Cues: The indicator includes visual levels for neutral, overbought, and oversold conditions to aid in quick decision-making.
Alerts: Basic alert conditions are included for when AMI moves into overbought or oversold territory, which traders can customize further.
Customizable: All parameters can be adjusted within TradingView to tailor the indicator to different market conditions or trading strategies.
Smoothing: Included an SMA for AMI to reduce noise and give smoother signals.
Divergence Detection: Implemented a basic divergence detection mechanism to spot potential reversals.
Usage Tips:
Overbought/Oversold: When AMI goes above 0.7, it might suggest an overbought condition, potentially signaling a sell or take profit. Below -0.7 might indicate oversold conditions, suggesting a buy opportunity.
Divergence: Watch for divergences between the AMI and price action for signals of potential trend reversals.
Crossing Zero: The AMI crossing from negative to positive might be used as a buy signal, and vice versa for a sell signal.
This script provides a new way to view momentum by consolidating multiple traditional indicators into one, potentially offering clearer signals in complex market environments.
Greedy Strategy 20 10 4 – High-Accuracy BTC/USD The Greedy Strategy 20 10 4 is a high-performance BTC/USD trading strategy designed for traders who seek high win rates and low risk exposure. This strategy leverages price action, volatility analysis, and trend-following indicators to generate accurate buy and sell signals...High Win Rate (90%) – Optimized for consistent profitability
✅ Smart Entry & Exit – Uses adaptive algorithms for precise trade timing
✅ Risk-Managed Drawdown (0.00%) – Ensures capital protection
✅ Works on 15-Minute BTC/USD Charts – Optimized for short-term traders.📊 Backtest Performance (Jan 2025 – Feb 2025)
Net Profit: $6,091.90 USD (0.61% per trade)
Total Trades: 10
Win Rate: 90%
Profit Factor: 92.9 (Very high)
Max Drawdown: $1.00 USD (0.00%)
Avg Trade Profit: $609.19 per trade.
free to use if you would like. Thank you.
BTC Cash And Carry Arbitrage compare month 6 by SeoNo1Add a calculation table for Bitcoin Cash and Carry Arbitrage comparing Month 6 to the top right of the chart, displaying the Spread and APY values clearly for easy strategy execution.
BB & SMA Alerts (Universal)This script will:
Plot Bollinger Bands (BB 20, 2 StdDev)
Plot SMA 50 & SMA 200 for trend analysis
Send alerts when price crosses BB, SMA 50, or SMA 200
Detect Golden Cross (Bullish) & Death Cross (Bearish) signals
Do note that this is not a guarantee as markets are often irrational, hence these indicators are supposed to supplement your decision making process and not to be used as 100% truth.
The assumptions are made as a universal format that can be used for most asset classes in Equities, Futures, Crypto.
Have not tested it on Funds, Bonds.
Appendix:
Best Practice: Use 20-SMA for Bollinger Bands and keep 50/200-SMA for trend confirmation.
SMA
• Short-Term (Fast) → 9 SMA (Great for intraday trades)
• Medium-Term → 50 SMA (Good for swing trading)
• Long-Term (Slow) → 200 SMA (For overall trend direction)
BB
Why Bollinger Bands Use SMA 20?
• Shorter time frame captures price fluctuations.
• More reactive to price changes → good for reversion trades.
• If you increase it to 50 or 200, Bollinger Bands will be too wide → making it hard to trade reversion.
• Bollinger Bands (50-SMA) → Becomes less sensitive to short-term price swings.
• Bollinger Bands (200-SMA) → Almost useless for mean reversion, since price barely touches bands.
Suggested Use Case:
🔹 Use BB (20-SMA) for entry signals.
🔹 Use 50-SMA & 200-SMA to confirm trend direction.
🔹 Example Trading Strategy:
• If price touches lower BB AND is above 200-SMA → Look for a BUY.
• If price touches upper BB AND is below 200-SMA → Look for a SELL.
RocketScience: Instantaneous BBTrading Three Pushes
The three pushes pattern is a trading strategy used to identify potential trend reversals. It involves observing three consecutive price movements (pushes) in one direction, followed by a reversal. The push starts with an impulse (make sure to know what an impulse is), and is confirmed with a low (bullish) testing the median or lower. The pattern is often seen on chart trading and can be applied to various markets, including stocks, forex, and commodities. Look at the arrows. The first push is confirmed by the lows at the median or lower...we count one. The second push extended, and then retraced to the median. This last third push is waiting for a retracement. At this point walk the band. Walking a band is waiting for the price to reach the median...to not exit prematurely.
To trade the three pushes pattern, traders should:
Identify the three pushes: Look for three consecutive price movements in one direction.
Confirm the pattern: Ensure the third push is followed by a reversal in price.
Set entry and exit points: Enter the trade after the third push and exit when the price reverses or reaches a predetermined target.
Trading Inner Quarters
Inner quarters theory is a concept used by traders to identify key support and resistance levels based on whole numbers and quarter points. Notice the chart, the upper inner range is resistance...it is bought through and "stood" on during child retracements. The theory suggests that banks, institutions, and countries use these levels to transact with foreign currencies, making them significant areas of price action.
To trade inner quarters, traders should:
Identify the inner quarters: define by the inner color-fill range.
Look for support and resistance: Identify key levels where the price has previously reversed or consolidated...usually a price reaction near the support or resistance.
Use these levels for entry and exit points: Enter trades at support levels and exit at resistance levels, or vice versa.
publicRocketScience21This returns a Rocket Science Instantaneous Trendline from a price source.
An example of a good call:
import privatepizza111/publicSourceInput/1 as srcIn
import privatepizza111/publicRocketScience21/1 as rocketSci21
//@variable
array src = array.new_float(13, array.get(srcIn.priceStream(13, hlc3), 0))
//@variable
array twentyOne = array.new_float(21, array.get(rocketSci21.instant(array.get(src, 0)), 0))