Payday Anomaly StrategyThe "Payday Effect" refers to a predictable anomaly in financial markets where stock returns exhibit significant fluctuations around specific pay periods. Typically, these are associated with the beginning, middle, or end of the month when many investors receive wages and salaries. This influx of funds, often directed automatically into retirement accounts or investment portfolios (such as 401(k) plans in the United States), temporarily increases the demand for equities. This phenomenon has been linked to a cycle where stock prices rise disproportionately on and around payday periods due to increased buy-side liquidity.
Academic research on the payday effect suggests that this pattern is tied to systematic cash flows into financial markets, primarily driven by employee retirement and savings plans. The regularity of these cash infusions creates a calendar-based pattern that can be exploited in trading strategies. Studies show that returns on days around typical payroll dates tend to be above average, and this pattern remains observable across various time periods and regions.
The rationale behind the payday effect is rooted in the behavioral tendencies of investors, specifically the automatic reinvestment mechanisms used in retirement funds, which align with monthly or semi-monthly salary payments. This regular injection of funds can cause market microstructure effects where stock prices temporarily increase, only to stabilize or reverse after the funds have been invested. Consequently, the payday effect provides traders with a potentially profitable opportunity by predicting these inflows.
Scientific Bibliography on the Payday Effect
Ma, A., & Pratt, W. R. (2017). Payday Anomaly: The Market Impact of Semi-Monthly Pay Periods. Social Science Research Network (SSRN).
This study provides a comprehensive analysis of the payday effect, exploring how returns tend to peak around payroll periods due to semi-monthly cash flows. The paper discusses how systematic inflows impact returns, leading to predictable stock performance patterns on specific days of the month.
Lakonishok, J., & Smidt, S. (1988). Are Seasonal Anomalies Real? A Ninety-Year Perspective. The Review of Financial Studies, 1(4), 403-425.
This foundational study explores calendar anomalies, including the payday effect. By examining data over nearly a century, the authors establish a framework for understanding seasonal and monthly patterns in stock returns, which provides historical support for the payday effect.
Owen, S., & Rabinovitch, R. (1983). On the Predictability of Common Stock Returns: A Step Beyond the Random Walk Hypothesis. Journal of Business Finance & Accounting, 10(3), 379-396.
This paper investigates predictability in stock returns beyond random fluctuations. It considers payday effects among various calendar anomalies, arguing that certain dates yield predictable returns due to regular cash inflows.
Loughran, T., & Schultz, P. (2005). Liquidity: Urban versus Rural Firms. Journal of Financial Economics, 78(2), 341-374.
While primarily focused on liquidity, this study provides insight into how cash flows, such as those from semi-monthly paychecks, influence liquidity levels and consequently impact stock prices around predictable pay dates.
Ariel, R. A. (1990). High Stock Returns Before Holidays: Existence and Evidence on Possible Causes. The Journal of Finance, 45(5), 1611-1626.
Ariel’s work highlights stock return patterns tied to certain dates, including paydays. Although the study focuses on pre-holiday returns, it suggests broader implications of predictable investment timing, reinforcing the calendar-based effects seen with payday anomalies.
Summary
Research on the payday effect highlights a repeating pattern in stock market returns driven by scheduled payroll investments. This cyclical increase in stock demand aligns with behavioral finance insights and market microstructure theories, offering a valuable basis for trading strategies focused on the beginning, middle, and end of each month.
Educational
Pine Execution MapPine Script Execution Map
Overview:
This is an educational script for Pine Script developers. The script includes data structure, functions/methods, and process to capture and print Pine Script execution map of functions called while pine script execution.
Map of execution is produced for last/latest candle execution.
The script also has example code to call execution map methods and generate Pine Execution map.
Use cases:
Pine script developers can get view of how the functions are called
This can also be used while debugging the code and know which functions are called vs what developer expect code to do
One can use this while using any of the open source published script and understand how public script is organized and how functions of the script are called.
Code components:
User defined type
type EMAP
string group
string sub_group
int level
array emap = array.new()
method called internally by other methods to generate level of function being executed
method id(string tag) =>
if(str.startswith(tag, "MAIN"))
exe_level.set(0, 0)
else if(str.startswith(tag, "END"))
exe_level.set(0, exe_level.get(0) - 1)
else
exe_level.set(0, exe_level.get(0) + 1)
exe_level.get(0)
Method called from main/global scope to record execution of main scope code. There should be only one call to this method at the start of global scope.
method main(string tag) =>
this = EMAP.new()
this.group := "MAIN"
this.sub_group := tag
this.level := "MAIN".id()
emap.push(this)
Method called from main/global scope to record end of execution of main scope code. There should be only one call to this method at the end of global scope.
method end_main(string tag) =>
this = EMAP.new()
this.group := "END_MAIN"
this.sub_group := tag
this.level := 0
emap.push(this)
Method called from start of each function to record execution of function code
method call(string tag) =>
this = EMAP.new()
this.group := "SUB"
this.sub_group := tag
this.level := "SUB".id()
emap.push(this)
Method called from end of each function to record end of execution of function code
method end_call(string tag) =>
this = EMAP.new()
this.group := "END_SUB"
this.sub_group := tag
this.level := "END_SUB".id()
emap.push(this)
Pine code which generates execution map and show it as a label tooltip.
if(barstate.islast)
for rec in emap
if(not str.startswith(rec.group, "END"))
lvl_tab = str.repeat("", rec.level+1, "\t")
txt = str.format("=> {0} {1}> {2}", lvl_tab, rec.level, rec.sub_group)
debug.log(txt)
debug.lastr()
Snapshot 1:
This is the output of the script and can be viewed by hovering mouse pointer over the blue color diamond shaped label
Snapshot 2:
How to read the Pine execution map
Customizable BTC Seasonality StrategyThis strategy leverages intraday seasonality effects in Bitcoin, specifically targeting hours of statistically significant returns during periods when traditional financial markets are closed. Padysak and Vojtko (2022) demonstrate that Bitcoin exhibits higher-than-average returns from 21:00 UTC to 23:00 UTC, a period in which all major global exchanges, such as the New York Stock Exchange (NYSE), Tokyo Stock Exchange, and London Stock Exchange, are closed. The absence of competing trading activity from traditional markets during these hours appears to contribute to these statistically significant returns.
The strategy proceeds as follows:
Entry Time: A long position in Bitcoin is opened at a user-specified time, which defaults to 21:00 UTC, aligning with the beginning of the identified high-return window.
Holding Period: The position is held for two hours, capturing the positive returns typically observed during this period.
Exit Time: The position is closed at a user-defined time, defaulting to 23:00 UTC, allowing the strategy to exit as the favorable period concludes.
This simple seasonality strategy aims to achieve a 33% annualized return with a notably reduced volatility of 20.93% and maximum drawdown of -22.45%. The results suggest that investing only during these high-return hours is more stable and less risky than a passive holding strategy (Padysak & Vojtko, 2022).
References
Padysak, M., & Vojtko, R. (2022). Seasonality, Trend-following, and Mean reversion in Bitcoin.
Immediate Rebalance ICT [TradingFinder] No Imbalances - MTF Gaps🔵 Introduction
The concept of "Immediate Rebalance" in technical analysis is a powerful and advanced strategy within the ICT (Inner Circle Trader) framework, widely used to identify key market levels.
Unlike the "Fair Value Gap," which leaves a price gap requiring a retracement for a fill, an Immediate Rebalance fills the gap immediately, representing an instant balance that strengthens the prevailing market trend. This structure allows traders to quickly spot critical price zones, capitalizing on strong trend continuations without the need for price retracement.
The "Immediate Rebalance ICT" indicator leverages this concept, providing traders with automated identification of critical supply and demand zones, order blocks, liquidity voids, and key buy-side and sell-side liquidity levels.
Through features like crucial liquidity points and immediate rebalancing areas, this tool enables traders to perform precise real-time market analysis and seize profitable opportunities.
🔵 How to Use
The Immediate Rebalance indicator assists traders in identifying reliable trading signals by detecting and analyzing Immediate Rebalance zones. By focusing on supply and demand areas, the indicator pinpoints optimal entry and exit positions.
Here’s how to use the indicator in both bearish (Supply Immediate Rebalance) and bullish (Demand Immediate Rebalance) structures :
🟣 Bullish Structure (Demand Immediate Rebalance)
In a bullish scenario, the indicator detects a Demand Immediate Rebalance formed by two consecutive bullish candles with overlapping wicks. This structure signifies an immediate demand zone, where price instantly balances within the zone, reducing the likelihood of a revisit and indicating potential upside momentum.
Zone Identification : Look for two consecutive bullish candles with overlapping wicks, forming a demand zone. This structure, due to its rapid balance, usually does not require a revisit and supports further upward movement.
Entry and Exit Levels : If price revisits this zone, percentage markers, particularly 50% and 75%, act as supportive levels, creating ideal entry points for long positions.
Example : In the second image, an example of a Demand Immediate Rebalance is shown, where overlapping bullish candle shadows indicate immediate balance, supporting the continuation of the bullish trend.
🟣 Bearish Structure (Supply Immediate Rebalance)
In a bearish setup, the indicator identifies a Supply Immediate Rebalance when two consecutive bearish candles with overlapping wicks appear. This formation signals an immediate supply zone, suggesting a high probability of trend continuation to the downside, with minimal expectation for price to retrace back to this area.
Zone Identificatio n: Look for two consecutive bearish candles with overlapping shadows. This structure forms a supply area where price is expected to continue its downtrend without revisiting the zone.
Entry and Exit Level s: Should price revisit this zone, percentage-based levels (e.g., 50% and 75%) serve as potential resistance points, optimizing entry for short positions, especially if the downtrend is expected to persist.
Example : The attached chart illustrates a Supply Immediate Rebalance, where overlapping candle shadows define this area, reassuring traders of a continued downward trend with a low likelihood of price returning to this zone.
🔵 Settings
ImmR Filter : This filter allows users to adjust the detection of Immediate Rebalance zones in four modes, from "Very Aggressive" to "Very Defensive," based on zone width. The chosen mode controls the sensitivity of Immediate Rebalance detection, allowing users to fine-tune the indicator to their trading style.
Multi Time Frame : Enabling this option allows users to set the indicator to a specific timeframe (1 minute, 5 minutes, 15 minutes, 30 minutes, 1 hour, 4 hours, daily, weekly, or monthly), broadening the perspective for identifying Immediate Rebalance zones across multiple timeframes.
🔵 Conclusion
The Immediate Rebalance indicator, based on rapid balancing zones within supply and demand areas, serves as a powerful tool for market analysis and improving trade decision-making.
By accurately identifying zones where price achieves instant balance without gaps, the indicator highlights areas likely to support strong trend continuations, exempt from common retracements.
The indicator’s use of percentage levels enables traders to pinpoint optimal entry and exit points more effectively, with levels like 50% and 75% acting as support within demand zones and resistance within supply zones. This empowers traders to ride strong trends without the worry of abrupt reversals.
Overall, the Immediate Rebalance is a reliable tool for both professional and beginner traders seeking precise methods to recognize supply and demand zones, capitalizing on consistent trends.
By choosing appropriate settings and focusing on the zones highlighted by this indicator, traders can enter trades with greater confidence and improve their risk management.
Patrick [TFO]This Patrick indicator was made for the 1 year anniversary of my Spongebob indicator, which was an experiment in using the polyline features of Pine Script to draw complex subjects. This indicator was made with the same methodology, with some helper functions to make things a bit easier on myself. It's sole purpose is to display a picture of Patrick Star on your chart, particularly the "I have $3" meme.
The initial Spongebob indicator included more than 1300 lines of code, as there were several more shapes to account for compared to Patrick, however it was done rather inefficiently. I essentially used an anchor point for each "layer" or shape (eye, nose, mouth, etc.), and drew from that point. This resulted in a ton of trial and error as I had to be very careful about the anchor points for each and every layer, and then draw around that point. In this indicator, however, I gave myself a frame to work with by specifying fixed bounds that you'll see in the code: LEFT, RIGHT, TOP, and BOTTOM.
var y_size = 4
atr = ta.atr(50)
LEFT = bar_index + 10
RIGHT = LEFT + 200
TOP = open + atr * y_size
BOTTOM = open - atr * y_size
You may notice that the top and bottom scale with the atr, or Average True Range to account for varying price fluctuations on different assets.
With these limits established, I could write some simple functions to translate my coordinates, using a range of 0-100 to describe how far the X coordinates should be from left to right, where left is 0 and right is 100; and likewise how far the Y coordinates should be from bottom to top, where bottom is 0 and top is 100.
X(float P) =>
result = LEFT + math.floor((RIGHT - LEFT)*P/100)
Y(float P) =>
result = BOTTOM + (TOP - BOTTOM)*P/100
With these functions, I could then start drawing points much simpler, with respect to the overall frame of the picture. If I wanted a point in the dead center of the frame, I would choose X(50), Y(50) for example.
At this point, the process just became tediously drawing each layer of my reference picture, including but not limited to Patrick's body, arm, mouth, eyes, eyebrows, etc. I've attached the reference picture here (left), without the text enabled.
As tedious as this was to create, it was done much more efficiently than Spongebob, and the ideas used here will make it much easier to draw more complex subjects in the future.
Multi-Timeframe RangeThe Multi-Timeframe Range Indicator is designed for traders looking to monitor key price levels across various timeframes (Daily, Weekly, Monthly, Quarterly, and Yearly) directly on their charts. This indicator draws boxes and mid-lines for each timeframe’s high, low, and midpoint, enabling users to visualize price ranges and assess potential areas of support and resistance more effectively.
Features:
Dynamic Range Boxes: Displays the high, low, and midpoint levels for each specified timeframe, with customizable colors for easy differentiation.
Visual Cues for Monday’s Levels: Highlights Monday’s high, low, and midpoint levels each week to support intraday trading setups and weekly trend analysis.
Multi-Timeframe Flexibility: Easily toggle between timeframes to view ranges from daily to yearly, making this indicator suitable for both short-term and long-term traders.
Ideal Use Cases:
Identify key support and resistance zones based on multiple timeframes.
Assess weekly and monthly trends using the Monday range levels.
Gain insights into market structure across various timeframes.
Daily ATR 2 and 10 Percent Value
This indicator shows three values: the main ATR value, a 2% value,
and a 10% Value of the Daily ATR.
After you have added the indicator to your chart, follow these steps
to be able to see the values and labels on the right.
1. Right-click on the price level bar or click the gear icon at the bottom
2. Click on LABELS
3. Select with a check mark the following two
INDICATORS AND FINANCIAL NAME LABELS
and INDICATORS AND FINANCIAL VALUE LABELS
4. Look for D-ATR % Value, click on the gear icon and verify these settings
- D-ATR Lenght = 14
- ATR Lenght = 14
- Smoothing = RMA
- Timeframe = 1 Day
5. Select Wait for timeframe closes
6. Click on Defaults, Save as default, and click ok.
You can move the indicator to the top of your chart if preferred, by clicking
on Move pane up.
Slightly modifications from other indicators.
Weekly High/Low Day BreakdownThe "Weekly High/Low Day Breakdown" is a tool designed to help identify patterns in market behaviour by analysing the days of the week when weekly highs and lows occur. This indicator calculates the frequency and percentage of weekly highs and lows for each day from Monday to Sunday within the visible range of your chart.
Features:
Weekly Analysis: Calculates weekly highs and lows based on daily open high and low prices from Monday to Sunday.
Day-Specific Breakdown: Tracks which day of the week each weekly high and low occurred.
Visible Range Focus: Only considers data within the current visible range of your chart for precise analysis.
Interactive Table Display: Presents the results in an easy-to-read table directly on your chart.
How It Works:
Data Collection: Fetches daily high, low, day of the week, and time data regardless of your chart's timeframe. Uses these daily figures to determine the weekly high and low for each week.
Weekly Tracking: Monitors the day of the week when the weekly high and low prices occur. Resets tracking at the end of each week (Sunday).
Visible Range Analysis: Only includes weeks that fall entirely within the visible time range of your chart. Ensures that the analysis is relevant to the period you are focusing on.
Percentage Calculation: Counts the occurrences of weekly highs and lows for each day. Calculates the percentage based on the total number of weeks in the visible range.
Result Display: Generates a table with days of the week as columns and "Weekly High" and "Weekly Low" as rows. Displays the percentage values, indicating how often highs and lows occur on each day.
How to Use:
Add the Indicator: Apply the "Weekly High/Low Day Breakdown" indicator to your TradingView chart.
Adjust Visible Range: Zoom in or out to set the desired visible time range for your analysis.
Interpret the Table:
Columns: Represent days from Monday to Sunday.
"Weekly High" Row: Shows the percentage of times the weekly high occurred on each day. "Weekly Low" Row: Shows the percentage of times the weekly low occurred on each day.
Colors: Blue text indicates high percentages, red text indicates low percentages.
Example Interpretation:
If the table shows a 30% value under "Tuesday" for "Weekly High," it means that in 30% of the weeks within the visible range, the highest price of the week occurred on a Tuesday.
Similarly, a 40% value under "Friday" for "Weekly Low" indicates that 40% of the weekly lows happened on a Friday.
VWAP it GOODWhy: Instead of having 5 individual VWAP indicators, I found it beneficial for one view with a clean display. This VWAP indicator combines the daily, weekly, monthly, quarterly and annual into one color coded view. These colors and styles can be modified by the user.
A user can turn any timeframe off, but this is how I personally like to trade since it helps me better understand potential bounce or pullback areas.
Do your own research for what is best for you.
Custom Time Frame BackgroundThis indicator allows you to highlight custom time frames on your chart with alternating background colors. It's particularly useful for visualizing specific intervals that are not standard on TradingView, such as 4-hour, 6-hour, or any other custom duration you choose. Features:
Customizable time frames: Set any combination of minutes, hours, and days
Fallback to daily/weekly coloring if no custom time frame is set
User-defined colors for alternating backgrounds
How to use:
Add the indicator to your chart
In the settings, input your desired custom time frame:
Set 'Custom Minutes' for intervals less than an hour
Use 'Custom Hours' for hourly intervals
Use 'Custom Days' for daily intervals
Adjust 'Color 1' and 'Color 2' to your preferred background colors
Examples:
For a 4-hour time frame: Set Custom Hours to 4
For a 6-hour time frame: Set Custom Hours to 6
For a 2-day time frame: Set Custom Days to 2
If all inputs are set to 0, the indicator will default to daily coloring for intraday charts and weekly coloring for higher timeframes. This indicator helps traders visually segment their charts into custom intervals, making it easier to identify patterns and trends over specific time periods.
Z-Score Weighted Trend System I [InvestorUnknown]The Z-Score Weighted Trend System I is an advanced and experimental trading indicator designed to utilize a combination of slow and fast indicators for a comprehensive analysis of market trends. The system is designed to identify stable trends using slower indicators while capturing rapid market shifts through dynamically weighted fast indicators. The core of this indicator is the dynamic weighting mechanism that utilizes the Z-score of price , allowing the system to respond effectively to significant market movements.
Dynamic Z-Score-Based Weighting System
The Z-Score Weighted Trend System I utilizes the Z-score of price to assign weights dynamically to fast indicators. This mechanism is designed to capture rapid market shifts at potential turning points, providing timely entry and exit signals.
Traders can choose from two primary weighting mechanisms:
Threshold-Based Weighting: The fast indicators are given weight only when the absolute Z-score exceeds a user-defined threshold. Below this threshold, fast indicators have no impact on the final signal.
Continuous Weighting: By setting the threshold to zero, fast indicators always contribute to the final signal, regardless of Z-score levels. However, this increases the likelihood of false signals during ranging or low-volatility markets
// Calculate weight for Fast Indicators based on Z-Score (Slow Indicator weight is kept to 1 for simplicity)
f_zscore_weights(series float z, simple float weight_thre) =>
float fast_weight = na
float slow_weight = na
if weight_thre > 0
if math.abs(z) <= weight_thre
fast_weight := 0
slow_weight := 1
else
fast_weight := 0 + math.sqrt(math.abs(z))
slow_weight := 1
else
fast_weight := 0 + math.sqrt(math.abs(z))
slow_weight := 1
Choice of Z-Score Normalization
Traders have the flexibility to select different Z-score processing methods to better suit their trading preferences:
Raw Z-Score or Moving Average: Traders can opt for either the raw Z-score or a moving average of the Z-score to smooth out fluctuations.
Normalized Z-Score (ranging from -1 to 1) or Z-Score Percentile: The normalized Z-score is simply the raw Z-score divided by 3, while the Z-score percentile utilizes a normal distribution for transformation.
f_zscore_perc(series float zscore_src, simple int zscore_len, simple string zscore_a, simple string zscore_b, simple string ma_type, simple int ma_len) =>
z = (zscore_src - ta.sma(zscore_src, zscore_len)) / ta.stdev(zscore_src, zscore_len)
zscore = switch zscore_a
"Z-Score" => z
"Z-Score MA" => ma_type == "EMA" ? (ta.ema(z, ma_len)) : (ta.sma(z, ma_len))
output = switch zscore_b
"Normalized Z-Score" => (zscore / 3) > 1 ? 1 : (zscore / 3) < -1 ? -1 : (zscore / 3)
"Z-Score Percentile" => (f_percentileFromZScore(zscore) - 0.5) * 2
output
Slow and Fast Indicators
The indicator uses a combination of slow and fast indicators:
Slow Indicators (constant weight) for stable trend identification: DMI (Directional Movement Index), CCI (Commodity Channel Index), Aroon
Fast Indicators (dynamic weight) to identify rapid trend shifts: ZLEMA (Zero-Lag Exponential Moving Average), IIRF (Infinite Impulse Response Filter)
Each indicator is calculated using for-loop methods to provide a smoothed and averaged view of price data over varying lengths, ensuring stability for slow indicators and responsiveness for fast indicators.
Signal Calculation
The final trading signal is determined by a weighted combination of both slow and fast indicators. The slow indicators provide a stable view of the trend, while the fast indicators offer agile responses to rapid market movements. The signal calculation takes into account the dynamic weighting of fast indicators based on the Z-score:
// Calculate Signal (as weighted average)
float sig = math.round(((DMI*slow_w) + (CCI*slow_w) + (Aroon*slow_w) + (ZLEMA*fast_w) + (IIRF*fast_w)) / (3*slow_w + 2*fast_w), 2)
Backtest Mode and Performance Metrics
The indicator features a detailed backtesting mode, allowing traders to compare the effectiveness of their selected settings against a traditional Buy & Hold strategy. The backtesting provides:
Equity calculation based on signals generated by the indicator.
Performance metrics comparing Buy & Hold metrics with the system’s signals, including: Mean, positive, and negative return percentages, Standard deviations, Sharpe, Sortino, and Omega Ratios
// Calculate Performance Metrics
f_PerformanceMetrics(series float base, int Lookback, simple float startDate, bool Annualize = true) =>
// Initialize variables for positive and negative returns
pos_sum = 0.0
neg_sum = 0.0
pos_count = 0
neg_count = 0
returns_sum = 0.0
returns_squared_sum = 0.0
pos_returns_squared_sum = 0.0
neg_returns_squared_sum = 0.0
// Loop through the past 'Lookback' bars to calculate sums and counts
if (time >= startDate)
for i = 0 to Lookback - 1
r = (base - base ) / base
returns_sum += r
returns_squared_sum += r * r
if r > 0
pos_sum += r
pos_count += 1
pos_returns_squared_sum += r * r
if r < 0
neg_sum += r
neg_count += 1
neg_returns_squared_sum += r * r
float export_array = array.new_float(12)
// Calculate means
mean_all = math.round((returns_sum / Lookback), 4)
mean_pos = math.round((pos_count != 0 ? pos_sum / pos_count : na), 4)
mean_neg = math.round((neg_count != 0 ? neg_sum / neg_count : na), 4)
// Calculate standard deviations
stddev_all = math.round((math.sqrt((returns_squared_sum - (returns_sum * returns_sum) / Lookback) / Lookback)) * 100, 2)
stddev_pos = math.round((pos_count != 0 ? math.sqrt((pos_returns_squared_sum - (pos_sum * pos_sum) / pos_count) / pos_count) : na) * 100, 2)
stddev_neg = math.round((neg_count != 0 ? math.sqrt((neg_returns_squared_sum - (neg_sum * neg_sum) / neg_count) / neg_count) : na) * 100, 2)
// Calculate probabilities
prob_pos = math.round((pos_count / Lookback) * 100, 2)
prob_neg = math.round((neg_count / Lookback) * 100, 2)
prob_neu = math.round(((Lookback - pos_count - neg_count) / Lookback) * 100, 2)
// Calculate ratios
sharpe_ratio = math.round((mean_all / stddev_all * (Annualize ? math.sqrt(Lookback) : 1))* 100, 2)
sortino_ratio = math.round((mean_all / stddev_neg * (Annualize ? math.sqrt(Lookback) : 1))* 100, 2)
omega_ratio = math.round(pos_sum / math.abs(neg_sum), 2)
// Set values in the array
array.set(export_array, 0, mean_all), array.set(export_array, 1, mean_pos), array.set(export_array, 2, mean_neg),
array.set(export_array, 3, stddev_all), array.set(export_array, 4, stddev_pos), array.set(export_array, 5, stddev_neg),
array.set(export_array, 6, prob_pos), array.set(export_array, 7, prob_neu), array.set(export_array, 8, prob_neg),
array.set(export_array, 9, sharpe_ratio), array.set(export_array, 10, sortino_ratio), array.set(export_array, 11, omega_ratio)
// Export the array
export_array
//}
Calibration Mode
A Calibration Mode is included for traders to focus on individual indicators, helping them fine-tune their settings without the influence of other components. In Calibration Mode, the user can visualize each indicator separately, making it easier to adjust parameters.
Alerts
The indicator includes alerts for long and short signals when the indicator changes direction, allowing traders to set automated notifications for key market events.
// Alert Conditions
alertcondition(long_alert, "LONG (Z-Score Weighted Trend System)", "Z-Score Weighted Trend System flipped ⬆LONG⬆")
alertcondition(short_alert, "SHORT (Z-Score Weighted Trend System)", "Z-Score Weighted Trend System flipped ⬇Short⬇")
Important Note:
The default settings of this indicator are not optimized for any particular market condition. They are generic starting points for experimentation. Traders are encouraged to use the calibration tools and backtesting features to adjust the system to their specific trading needs.
The results generated from the backtest are purely historical and are not indicative of future results. Market conditions can change, and the performance of this system may differ under different circumstances. Traders and investors should exercise caution and conduct their own research before using this indicator for any trading decisions.
30D Vs 90D Historical VolatilityVolatility equals risk for an underlying asset's price meaning bullish volatility is bearish for prices while bearish volatility is bullish. This compares 30-Day Historical Volatility to 90-Day Historical Volatility.
When the 30-Day crosses under the 90-day, this is typically when asset prices enter a bullish trend.
Conversely, When the 30-Day crosses above the 90-Day, this is when asset prices enter a bearish trend.
Peaks in volatility are bullish divergences while troughs are bearish divergences.
4AM-5AM BRT HighlighterThe 4AM-5AM BRT Highlighter is a simple yet effective tool designed to visually mark your preferred trading time on the chart. It highlights the period between 4:00 AM and 5:00 AM Brazilian Time (BRT/UTC-3) by default, helping you stay focused and aware of your prime trading window.
Key Features:
Clear Visual Highlight: Colors the background of your chart during the chosen timeframe, making it easy to see when your trading session starts and ends.
Customizable Colors: Easily adjust the highlight color and transparency to suit your visual preferences.
Accurate Time Conversion: Automatically accounts for Brazilian Time (BRT), ensuring the highlight appears correctly no matter your chart’s default timezone.
Whether you're trading currencies, metals, indexes, or cryptocurrencies, this indicator helps you maintain focus during your dedicated trading hour by clearly marking your active period on the chart.
Buy and Sell Signals Based on SMI {K28}Buy/Sell Signals Based on SMI
This indicator provides buy and sell signals based on the Stochastic Momentum Index (SMI) to assist traders in identifying potential entry and exit points in the market. Here’s how to effectively use this indicator:
Usage Instructions:
Signal Interpretation:
No signal is 100% guaranteed
Green Labels: Indicate strong buy signals when the SMI crosses above its EMA, especially if the candle is green (closing price higher than opening price).
Red Labels: Indicate strong sell signals when the SMI crosses below its EMA.
Cautious Signals:
Blue Buy Labels: These buy signals appear when the SMI is in a cautious zone (between -20 and 20). They may not be as reliable, so confirm these signals with other indicators before acting.
Yellow Sell Labels: These buy signals appear when the SMI is in a cautious zone (between -20 and 20). They may not be as reliable, so confirm these signals with other indicators before acting.
Gray Buy and Sell Labels: Indicate potential false signals (when the SMI is overbought or oversold). Use other confirmation indicators to verify these signals.
Trade Strategy:
This indicator is designed for traders looking to make small, consistent profits. Focus on executing more trades rather than waiting for larger price movements.
Be mindful that the indicator may yield frequent signals, so it's essential to maintain discipline and only take trades that meet your criteria for confirmation.
Important Notes:
Caution with Signals: Always exercise caution when acting on blue or gray labels. These may indicate less reliable signals, so it's crucial to confirm with additional indicators.
No Perfect Indicator: Please remember that no trading indicator is perfect. Use this indicator at your own risk, and consider incorporating risk management strategies into your trading plan.
Conclusion:
By employing this SMI indicator, you can enhance your trading strategy focused on generating small, consistent profits through frequent trades. However, always verify signals and stay aware of market conditions to optimize your trading performance.
Smart Money Setup 07 [TradingFinder] Liquidity Hunts & Minor OB🔵 Introduction
The Smart Money Concept relies on analyzing market structure, tracking liquidity flows, and identifying order blocks. Research indicates that traders who apply these methods can improve their accuracy in predicting market movements by up to 30%.
These elements allow traders to understand the behavior of market makers, including banks and large financial institutions, which have the ability to influence price movements and shape major market trends. By recognizing how these entities operate, traders can align their strategies with Smart Money actions and better anticipate shifts in the market.
Smart Money typically enters the market at points of high liquidity where trading opportunities are more attractive. By following these liquidity flows, professional traders can position themselves at market reversal points, leading to profitable trades.
The Smart Money Setup 07 indicator has been specifically designed to detect these complex patterns. Using advanced algorithms, this indicator automatically identifies both bullish and bearish trading setups, assisting traders in discovering hidden market opportunities.
As a powerful technical analysis tool, the Smart Money Setup indicator helps predict the actions of major market participants and highlights optimal entry and exit points. Essentially, this tool enables traders to act like institutional investors and market makers, making the most of price fluctuations in their favor.
Ultimately, the Smart Money Setup 07 indicator transforms complex technical analysis into a simple and practical tool. By detecting order blocks and liquidity zones, this tool helps traders execute their strategies with greater precision, leading to more informed and successful trading decisions.
🟣 Bullish Setup
🟣 Bearish Setup
🔵 How to Use
One of the key strengths of the Smart Money Setup 07 indicator is its ability to accurately identify order blocks and analyze liquidity flows. Order blocks represent areas where large buy or sell orders are placed by Smart Money investors, which often indicate key reversal points in the market. Traders can use these order blocks to pinpoint potential entry and exit opportunities.
The Smart Money Setup indicator detects and visually displays these order blocks on the chart, helping traders identify the best zones to enter or exit trades. Since these zones are frequently used by large institutional investors, following these blocks allows traders to capitalize on price fluctuations and trade with confidence.
🟣 Bullish Smart Money Setup
A Bullish Smart Money Setup forms when the market creates Higher Lows and Higher Highs. In this situation, the indicator analyzes pivot points, liquidity flows, and order blocks to identify buy opportunities. Liquidity points in these setups indicate areas where Smart Money is likely to enter long positions.
In the bullish setup image, multiple Higher Lows and Higher Highs are formed. The green zone represents a Bullish Order Block, signaling traders to enter a long trade. The Smart Money Setup indicator displays a green arrow, indicating a high-probability upward price movement from this liquidity zone.
🟣 Bearish Smart Money Setup
A Bearish Smart Money Setup occurs when the market structure shows Lower Highs and Lower Lows, indicating weakness in price. The indicator identifies these patterns and highlights potential sell opportunities. Liquidity points in this setup mark areas where Smart Money enters sell positions.
In the bearish setup image, a Lower High is followed by a Lower Low, with the red liquidity zone acting as a Bearish Order Block. The Smart Money Setup indicator shows a red arrow, signaling a likely downward move, offering traders an opportunity to enter short positions.
🔵 Settings
Pivot Period : This setting determines how many candles are needed to form a pivot point. A default value of 2 is optimal for quickly identifying key pivot points in price action.
Order Block Validity Period : This parameter defines the lifespan of an order block. Traders can adjust how long each order block remains valid. For instance, setting it to 500 means that an order block will be valid for 500 bars after its formation.
Mitigation Level OB : This setting allows traders to select whether order blocks should be based on the "Proximal," "50% OB," or "Distal" levels, helping traders manage risk more effectively.
Order Block Refinement : Traders can refine the order blocks with precision. The indicator offers two refinement modes: Defensive and Aggressive. The Defensive mode identifies safer order blocks, while the Aggressive mode targets higher-risk blocks with the potential for larger reversals.
🔵 Conclusion
The Smart Money Setup 07 indicator is a powerful tool for identifying key Smart Money movements in the market. It provides traders with essential insights for making informed trading decisions, particularly when combined with technical analysis and liquidity flow analysis. This indicator allows traders to accurately pinpoint entry and exit points, helping them maximize profits and minimize risk.
By offering a range of customizable settings, the Smart Money Setup indicator adapts to different trading styles and strategies. Furthermore, its ability to detect order blocks and identify supply and demand zones makes it an indispensable tool for any trader looking to enhance their strategy.
In conclusion, the Smart Money Setup 07 is a crucial tool for traders aiming to optimize their trading performance. By utilizing the concepts of Smart Money in technical analysis, traders can make more precise decisions and take advantage of market fluctuations.
Keltner Channel Strategy by Kevin DaveyKeltner Channel Strategy Description
The Keltner Channel Strategy is a volatility-based trading approach that uses the Keltner Channel, a technical indicator derived from the Exponential Moving Average (EMA) and Average True Range (ATR). The strategy helps identify potential breakout or mean-reversion opportunities in the market by plotting upper and lower bands around a central EMA, with the channel width determined by a multiplier of the ATR.
Components:
1. Exponential Moving Average (EMA):
The EMA smooths price data by placing greater weight on recent prices, allowing traders to track the market’s underlying trend more effectively than a simple moving average (SMA). In this strategy, a 20-period EMA is used as the midline of the Keltner Channel.
2. Average True Range (ATR):
The ATR measures market volatility over a 14-period lookback. By calculating the average of the true ranges (the greatest of the current high minus the current low, the absolute value of the current high minus the previous close, or the absolute value of the current low minus the previous close), the ATR captures how much an asset typically moves over a given period.
3. Keltner Channel:
The upper and lower boundaries are set by adding or subtracting 1.5 times the ATR from the EMA. These boundaries create a dynamic range that adjusts with market volatility.
Trading Logic:
• Long Entry Condition: The strategy enters a long position when the closing price falls below the lower Keltner Channel, indicating a potential buying opportunity at a support level.
• Short Entry Condition: The strategy enters a short position when the closing price exceeds the upper Keltner Channel, signaling a potential selling opportunity at a resistance level.
The strategy plots the upper and lower Keltner Channels and the EMA on the chart, providing a visual representation of support and resistance levels based on market volatility.
Scientific Support for Volatility-Based Strategies:
The use of volatility-based indicators like the Keltner Channel is supported by numerous studies on price momentum and volatility trading. Research has shown that breakout strategies, particularly those leveraging volatility bands such as the Keltner Channel or Bollinger Bands, can be effective in capturing trends and reversals in both trending and mean-reverting markets  .
Who is Kevin Davey?
Kevin Davey is a highly respected algorithmic trader, author, and educator, known for his systematic approach to building and optimizing trading strategies. With over 25 years of experience in the markets, Davey has earned a reputation as an expert in quantitative and rule-based trading. He is particularly well-known for winning several World Cup Trading Championships, where he consistently demonstrated high returns with low risk.
Advanced Multi-Seasonality StrategyThe Multi-Seasonality Strategy is a trading system based on seasonal market patterns. Seasonality refers to recurring market trends driven by predictable calendar-based events. These patterns emerge due to economic cycles, corporate activities (e.g., earnings reports), and investor behavior around specific times of the year. Studies have shown that such effects can influence asset prices over defined periods, leading to opportunities for traders who exploit these patterns (Hirshleifer, 2001; Bouman & Jacobsen, 2002).
How the Strategy Works:
The strategy allows the user to define four distinct periods within a calendar year. For each period, the trader selects:
Entry Date (Month and Day): The date to enter the trade.
Holding Period: The number of trading days to remain in the trade after the entry.
Trade Direction: Whether to take a long or short position during that period.
The system is designed with flexibility, enabling the user to activate or deactivate each of the four periods. The idea is to take advantage of seasonal patterns, such as buying during historically strong periods and selling during weaker ones. A well-known example is the "Sell in May and Go Away" phenomenon, which suggests that stock returns are higher from November to April and weaker from May to October (Bouman & Jacobsen, 2002).
Seasonality in Financial Markets:
Seasonal effects have been documented across different asset classes and markets:
Equities: Stock markets tend to exhibit higher returns during certain months, such as the "January effect," where prices rise after year-end tax-loss selling (Haugen & Lakonishok, 1987).
Commodities: Agricultural commodities often follow seasonal planting and harvesting cycles, which impact supply and demand patterns (Fama & French, 1987).
Forex: Currency pairs may show strength or weakness during specific quarters based on macroeconomic factors, such as fiscal year-end flows or central bank policy decisions.
Scientific Basis:
Research shows that market anomalies like seasonality are linked to behavioral biases and institutional practices. For example, investors may respond to tax incentives at the end of the year, and companies may engage in window dressing (Haugen & Lakonishok, 1987). Additionally, macroeconomic factors, such as monetary policy shifts and holiday trading volumes, can also contribute to predictable seasonal trends (Bouman & Jacobsen, 2002).
Risks of Seasonal Trading:
While the strategy seeks to exploit predictable patterns, there are inherent risks:
Market Changes: Seasonal effects observed in the past may weaken or disappear as market conditions evolve. Increased algorithmic trading, globalization, and policy changes can reduce the reliability of historical patterns (Lo, 2004).
Overfitting: One of the risks in seasonal trading is overfitting the strategy to historical data. A pattern that worked in the past may not necessarily work in the future, especially if it was based on random chance or external factors that no longer apply (Sullivan, Timmermann, & White, 1999).
Liquidity and Volatility: Trading during specific periods may expose the trader to low liquidity, especially around holidays or earnings seasons, leading to slippage and larger-than-expected price swings.
Economic and Geopolitical Shocks: External events such as pandemics, wars, or political instability can disrupt seasonal patterns, leading to unexpected market behavior.
Conclusion:
The Multi-Seasonality Strategy capitalizes on the predictable nature of certain calendar-based patterns in financial markets. By entering and exiting trades based on well-established seasonal effects, traders can potentially capture short-term profits. However, caution is necessary, as market dynamics can change, and seasonal patterns are not guaranteed to persist. Rigorous backtesting, combined with risk management practices, is essential to successfully implementing this strategy.
References:
Bouman, S., & Jacobsen, B. (2002). The Halloween Indicator, "Sell in May and Go Away": Another Puzzle. American Economic Review, 92(5), 1618-1635.
Fama, E. F., & French, K. R. (1987). Commodity Futures Prices: Some Evidence on Forecast Power, Premiums, and the Theory of Storage. Journal of Business, 60(1), 55-73.
Haugen, R. A., & Lakonishok, J. (1987). The Incredible January Effect: The Stock Market's Unsolved Mystery. Dow Jones-Irwin.
Hirshleifer, D. (2001). Investor Psychology and Asset Pricing. Journal of Finance, 56(4), 1533-1597.
Lo, A. W. (2004). The Adaptive Markets Hypothesis: Market Efficiency from an Evolutionary Perspective. Journal of Portfolio Management, 30(5), 15-29.
Sullivan, R., Timmermann, A., & White, H. (1999). Data-Snooping, Technical Trading Rule Performance, and the Bootstrap. Journal of Finance, 54(5), 1647-1691.
This strategy harnesses the power of seasonality but requires careful consideration of the risks and potential changes in market behavior over time.
Statistical ArbitrageThe Statistical Arbitrage Strategy, also known as pairs trading, is a quantitative trading method that capitalizes on price discrepancies between two correlated assets. The strategy assumes that over time, the prices of these two assets will revert to their historical relationship. The core idea is to take advantage of mean reversion, a principle suggesting that asset prices will revert to their long-term average after deviating significantly.
Strategy Mechanics:
1. Selection of Correlated Assets:
• The strategy focuses on two historically correlated assets (e.g., equity index futures like Dow Jones Mini and S&P 500 Mini). These assets tend to move in the same direction due to similar underlying fundamentals, such as overall market conditions. By tracking their relative prices, the strategy seeks to exploit temporary mispricings.
2. Spread Calculation:
• The spread is the difference between the prices of the two assets. This spread represents the relationship between the assets and serves as the basis for determining when to enter or exit trades.
3. Mean and Standard Deviation:
• The historical average (mean) of the spread is calculated using a Simple Moving Average (SMA) over a chosen period. The strategy also computes the standard deviation (volatility) of the spread, which measures how far the spread has deviated from the mean over time. This allows the strategy to define statistically significant price deviations.
4. Entry Signal (Mean Reversion):
• A buy signal is triggered when the spread falls below the mean by a multiple (e.g., two) of the standard deviation. This indicates that one asset is temporarily undervalued relative to the other, and the strategy expects the spread to revert to its mean, generating profits as the prices converge.
5. Exit Signal:
• The strategy exits the trade when the spread reverts to the mean. At this point, the mispricing has been corrected, and the profit from the mean reversion is realized.
Academic Support:
Statistical arbitrage has been widely studied in finance and economics. Gatev, Goetzmann, and Rouwenhorst’s (2006) landmark study on pairs trading demonstrated that this strategy could generate excess returns in equity markets. Their research found that by focusing on historically correlated stocks, traders could identify pricing anomalies and profit from their eventual correction.
Additionally, Avellaneda and Lee (2010) explored statistical arbitrage in different asset classes and found that exploiting deviations in price relationships can offer a robust, market-neutral trading strategy. In these studies, the strategy’s success hinges on the stability of the relationship between the assets and the timely execution of trades when deviations occur.
Risks of Statistical Arbitrage:
1. Correlation Breakdown:
• One of the primary risks is the breakdown of correlation between the two assets. Statistical arbitrage assumes that the historical relationship between the assets will hold in the future. However, market conditions, company fundamentals, or external shocks (e.g., macroeconomic changes) can cause these assets to deviate permanently, leading to potential losses.
• For instance, if two equity indices historically move together but experience divergent economic conditions or policy changes, their prices may no longer revert to the expected mean.
2. Execution Risk:
• This strategy relies on efficient execution and tight spreads. In volatile or illiquid markets, the actual price at which trades are executed may differ significantly from expected prices, leading to slippage and reduced profits.
3. Market Risk:
• Although statistical arbitrage is designed to be market-neutral (i.e., not dependent on the overall market direction), it is not entirely risk-free. Systematic market shocks, such as financial crises or sudden shifts in market sentiment, can affect both assets simultaneously, causing the spread to widen rather than revert to the mean.
4. Model Risk:
• The assumptions underlying the strategy, particularly regarding mean reversion, may not always hold true. The model assumes that asset prices will return to their historical averages within a certain timeframe, but the timing and magnitude of mean reversion can be uncertain. Misestimating this timeframe can lead to extended drawdowns or unrealized losses.
5. Overfitting:
• Over-reliance on historical data to fine-tune the strategy parameters (e.g., the lookback period or standard deviation thresholds) may result in overfitting. This means that the strategy works well on past data but fails to perform in live markets due to changing conditions.
Conclusion:
The Statistical Arbitrage Strategy offers a systematic and quantitative approach to trading that capitalizes on temporary price inefficiencies between correlated assets. It has been proven to generate returns in academic studies and is widely used by hedge funds and institutional traders for its market-neutral characteristics. However, traders must be aware of the inherent risks, including correlation breakdown, execution risks, and the potential for prolonged deviations from the mean. Effective risk management, diversification, and constant monitoring are essential for successfully implementing this strategy in live markets.
BTC ETF Flow Trading SignalsTracks large money flows (500M+) across major Bitcoin ETFs (IBIT, BTCO, FBTC, ARKB, BITB)
Generates long/short signals based on institutional money movement
Shows flow trends and strength of movements
This script provides a foundation for comparing ETF inflows and Bitcoin price. The effectiveness of the analysis depends on the quality of the data and your interpretation of the results. Key levels of 500M and 350M Inflow/Outflow Enjoy
Collaboration with Vivid Vibrations
Enjoy & improve!
Saturn Retrograde PeriodsSaturn Retrograde Periods Visualizer for TradingView
This Pine Script visualizes all Saturn retrograde periods since 2009, including the current retrograde ending on November 15, 2024. The script overlays yellow boxes on your TradingView chart to highlight the exact periods of Saturn retrograde. It's a great tool for astrologically-inclined traders or those interested in market timing based on astrological events.
Key Features:
Full Historical Coverage: Displays Saturn retrograde periods from 2009 (the inception of Bitcoin) to the current retrograde ending in November 2024.
Customizable Appearance: You can easily adjust the color and opacity of the boxes directly from the script's settings window, making it flexible for various chart styles.
Visual Clarity: The boxes span the full vertical range of your chart, ensuring the retrograde periods are clearly visible over any asset, timeframe, or price action.
How to Use:
Add the script to your TradingView chart.
Adjust the color and opacity in the settings to suit your preferences.
View all relevant Saturn retrograde periods and analyze how these astrological events may align with price movements in your selected asset.
This script is perfect for traders and analysts who want to combine astrology with financial market analysis!
scripted by chat.gpt - version 1.0
Macros ICT KillZones [TradingFinder] Times & Price Trading Setup🔵 Introduction
ICT Macros, developed by Michael Huddleston, also known as ICT (Inner Circle Trader), is a powerful trading tool designed to help traders identify the best trading opportunities during key time intervals like the London and New York trading sessions.
For traders aiming to capitalize on market volatility, liquidity shifts, and Fair Value Gaps (FVG), understanding and using these critical time zones can significantly improve trading outcomes.
In today’s highly competitive financial markets, identifying the moments when the market is seeking buy-side or sell-side liquidity, or filling price imbalances, is essential for maximizing profitability.
The ICT Macros indicator is built on the renowned ICT time and price theory, which enables traders to track and leverage key market dynamics such as breaks of highs and lows, imbalances, and liquidity hunts.
This indicator automatically detects crucial market times and optimizes strategies for traders by highlighting the specific moments when price movements are most likely to occur. A standout feature of ICT Macros is its automatic adjustment for Daylight Saving Time (DST), ensuring that traders remain synced with the correct session times.
This means you can rely on accurate market timing without the need for manual updates, allowing you to focus on capturing profitable trades during critical timeframes.
🔵 How to Use
The ICT Macros indicator helps you capitalize on trading opportunities during key market moments, particularly when the market is breaking highs or lows, filling Fair Value Gaps (FVG), or addressing imbalances. This indicator is particularly beneficial for traders who seek to identify liquidity, market volatility, and price imbalances.
🟣 Sessions
London Sessions
London Macro 1 :
UTC Time : 06:33 to 07:00
New York Time : 02:33 to 03:00
London Macro 2 :
UTC Time : 08:03 to 08:30
New York Time : 04:03 to 04:30
New York Sessions
New York Macro AM 1 :
UTC Time : 12:50 to 13:10
New York Time : 08:50 to 09:10
New York Macro AM 2 :
UTC Time : 13:50 to 14:10
New York Time : 09:50 to 10:10
New York Macro AM 3 :
UTC Time : 14:50 to 15:10
New York Time : 10:50 to 11:10
New York Lunch Macro :
UTC Time : 15:50 to 16:10
New York Time : 11:50 to 12:10
New York PM Macro :
UTC Time : 17:10 to 17:40
New York Time : 13:10 to 13:40
New York Last Hour Macro :
UTC Time : 19:15 to 19:45
New York Time : 15:15 to 15:45
These time intervals adjust automatically based on Daylight Saving Time (DST), helping traders to enter or exit trades during key market moments when price volatility is high.
Below are the main applications of this tool and how to incorporate it into your trading strategies :
🟣 Combining ICT Macros with Trading Strategies
The ICT Macros indicator can easily be used in conjunction with various trading strategies. Two well-known strategies that can be combined with this indicator include:
ICT 2022 Trading Model : This model is designed based on identifying market liquidity, structural price changes, and Fair Value Gaps (FVG). By using ICT Macros, you can identify the key time intervals when the market is seeking liquidity, filling imbalances, or breaking through important highs and lows, allowing you to enter or exit trades at the right moment.
Silver Bullet Strategy : This strategy, which is built around liquidity hunting and rapid price movements, can work more accurately with the help of ICT Macros. The indicator pinpoints precise liquidity times, helping traders take advantage of market shifts caused by filling Fair Value Gaps or correcting imbalances.
🟣 Capitalizing on Price Volatility During Key Times
Large market algorithms often seek liquidity or fill Fair Value Gaps (FVG) during the intervals marked by ICT Macros. These periods are when price volatility increases, and traders can use these moments to enter or exit trades.
For example, if sell-side liquidity is drained and the market fills an imbalance, the price might move toward buy-side liquidity. By identifying these moments, which may also involve breaking a previous high or low, you can leverage rapid market fluctuations to your advantage.
🟣 Identifying Liquidity and Price Imbalances
One of the important uses of ICT Macros is identifying points where the market is seeking liquidity and correcting imbalances. You can determine high or low liquidity levels in the market before each ICT Macro, as well as Fair Value Gaps (FVG) and price imbalances that need to be filled, using them to adjust your trading strategy. This capability allows you to manage trades based on liquidity shifts or imbalance corrections without needing a bias toward a specific direction.
🔵 Settings
The ICT Macros indicator offers various customization options, allowing users to tailor it to their specific needs. Below are the main settings:
Time Zone Mode : You can select one of the following options to define how time is displayed:
UTC : For traders who need to work with Universal Time.
Session Local Time : The local time corresponding to the London or New York markets.
Your Time Zone : You can specify your own time zone (e.g., "UTC-4:00").
Your Time Zone : If you choose "Your Time Zone," you can set your specific time zone. By default, this is set to UTC-4:00.
Show Range Time : This option allows you to display the time range of each session on the chart. If enabled, the exact start and end times of each interval are shown.
Show or Hide Time Ranges : Toggle on/off for visual clarity depending on user preference.
Custom Colors : Set distinct colors for each session, allowing users to personalize their chart based on their trading style.These settings allow you to adjust the key time intervals of each trading session to your preference and customize the time format according to your own needs.
🔵 Conclusion
The ICT Macros indicator is a powerful tool for traders, helping them to identify key time intervals where the market seeks liquidity or fills Fair Value Gaps (FVG), corrects imbalances, and breaks highs or lows. This tool is especially valuable for traders using liquidity-based strategies such as ICT 2022 or Silver Bullet.
One of the key features of this indicator is its support for Daylight Saving Time (DST), ensuring you are always in sync with the correct trading session timings without manual adjustments. This is particularly beneficial for traders operating across different time zones.
With ICT Macros, you can capitalize on crucial market opportunities during sensitive times, take advantage of imbalances, and enhance your trading strategies based on market volatility, liquidity shifts, and Fair Value Gaps.
Enhanced Kelly Criterion with Risk ManagementThis script is a trading tool for risk management and position size calculations based on the Kelly criteria. The objective is to calculate the optimal position size for each trade based on win/loss ratio and win/loss ratio to manage your money.
Overview
Initial Funding: Starting with an initial capital of $10,000, the balance (amount of funds) of both “bullish” and “bearish” positions will increase or decrease depending on the outcome of the trade.
Risk Management: Users can set their risk tolerance from 1-100%. In addition, the maximum position size per trade is also limited at 50%, for example. This setting allows the user to limit risk.
Record of trade results: For each trade, a positive (bullish) or negative (bearish) line is determined, and wins and losses are recorded accordingly. Win/loss ratios and win/loss ratios are also calculated in real time from this data.
Win rate: Calculates the percentage of winning trades in a trade.
Win/Loss Ratio: Calculates the ratio of profit/loss between positive and negative trades.
Position sizing using the Kelly Criterion: Based on the win/loss ratio, the optimal position size to take on the next trade is calculated using the Kelly Criterion. However, this Kelly Criterion is treated with caution because of the potential for increased risk.
Controlling Risk and Position Size
Volatility adjustment using ATR (Average True Range): The script considers market volatility (range of price fluctuation) using a measure called ATR. This allows for smaller position sizes when price volatility is high, thereby reducing risk.
Position Size Limit: The maximum position size is limited so that the calculated position size does not exceed a certain range. This reduces the risk of large losses.
Display of Results
The script visually plots the final position size and amount of funds so that traders can see the changes in balance. To highlight points of change, position size expansions and contractions are shown, allowing traders to catch signs of sudden fluctuations or changes in volatility.
Suggested Improvements and Considerations
Kelly Criteria Overexposure Risk: Calculations based on the Kelly Criteria are theoretically correct, but they tend to take large positions. This can be very damaging in the event of losses. Therefore, while this script limits risk by setting a maximum position size, it is recommended that you adjust to an even more modest position size.
Data Reliability: The calculation of win/loss ratios and win/loss ratios relies on historical trade data, which can be unreliable until sufficient trade data is gathered. When trade data is scarce, calculations based on the Kelly Criteria may be overly optimistic.
Volatility considerations: Volatility adjustment using ATR is effective, but ATR alone may not be sufficient when markets fluctuate rapidly; if ATR adjustment is insufficient, additional risk mitigation techniques should be used in conjunction.
Overall, this script emphasizes risk management and optimizes position size using the Kelly criteria, but real market conditions require careful risk management with attention to overexposure.
NYSE, Euronext, and Shanghai Stock Exchange Hours IndicatorNYSE, Euronext, and Shanghai Stock Exchange Hours Indicator
This script is designed to enhance your trading experience by visually marking the opening and closing hours of major global stock exchanges: the New York Stock Exchange (NYSE), Euronext, and Shanghai Stock Exchange. By adding vertical lines and background fills during trading sessions, it helps traders quickly identify these critical periods, potentially informing better trading decisions.
Features of This Indicator:
NYSE, Euronext, and Shanghai Stock Exchange Hours: Displays vertical lines at market open and close times for these three exchanges. You can easily switch between showing or hiding the different exchanges to customize the indicator for your needs.
Background Fill: Highlights the trading hours of these exchanges using faint background colors, making it easy to spot when markets are in session. This feature is crucial for timing trades around overlapping trading hours and volume peaks.
Customizable Visuals: Adjust the color, line style (solid, dotted, dashed), and line width to match your preferences, making the indicator both functional and visually aligned with your chart's aesthetics.
How to Use the Indicator:
Add the Indicator to Your Chart: Add the script to your chart from the TradingView script library. Once added, the indicator will automatically plot vertical lines at the opening and closing times of the NYSE, Euronext, and Shanghai Stock Exchange.
Customize Display Settings: Choose which exchanges to display by enabling or disabling the NYSE, Euronext, or Shanghai sessions in the indicator settings. This allows you to focus only on the exchanges that are relevant to your trading strategy.
Adjust Visual Properties: Customize the appearance of the vertical lines and background fill through the settings. Modify the color of each exchange, adjust the line style (solid, dotted, dashed), and control the line thickness to suit your chart preferences. The background fill can also be customized to clearly highlight active trading sessions.
Identify Key Market Hours: Use the vertical lines and background fills to identify the market open and close times. This is particularly useful for understanding how price action changes during specific trading hours or for finding high liquidity periods when multiple markets are open simultaneously.
Adapt Trading Strategies: By knowing when major stock exchanges are open, you can adapt your trading strategy to take advantage of potential price movements, increased volatility, or volume. This can help you avoid low-liquidity times and capitalize on more active trading periods.
This indicator is especially valuable for traders focusing on cross-market dynamics or those interested in understanding how different sessions influence market liquidity and price action. With this tool, you can gain insight into market conditions and adapt your trading strategies accordingly. The clean visual separation of session times helps you maintain context, whether you're trading Forex, stocks, or cryptocurrencies.
Disclaimer: This script is intended for informational and educational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. Always conduct your own research and consult with a licensed financial advisor before making any trading decisions. Trading involves risk, and past performance is not indicative of future results.