Liquidity Inducement Strategy//@version=5
indicator("Liquidity Inducement Strategy", overlay=true)
// تنظیمات ورودی
supportResistanceLevel = input.int(3, "Number of S/R Levels to Detect", minval=1, maxval=10)
confirmationMA = input.int(50, "Confirmation MA Length")
rsiThreshold = input.int(50, "RSI Threshold")
stopLossPercent = input.float(1, "Stop Loss (%)", minval=0.1)
// میانگین متحرک برای تشخیص جهت روند
ma = ta.sma(close, confirmationMA)
// RSI برای تأیید نقاط ورود
rsi = ta.rsi(close, 14)
// تابع تشخیص حمایت و مقاومت
var float srLevelUp = na
var float srLevelDown = na
if ta.change(ta.highest(high, supportResistanceLevel))
srLevelUp := ta.highest(high, supportResistanceLevel)
if ta.change(ta.lowest(low, supportResistanceLevel))
srLevelDown := ta.lowest(low, supportResistanceLevel)
// شناسایی شکست جعلی و تلهها در نزدیکی سطوح کلیدی
fakeoutUp = high > srLevelUp and close < srLevelUp
fakeoutDown = low < srLevelDown and close > srLevelDown
// شرایط ورود به معامله خرید و فروش
buySignal = fakeoutDown and close > ma and rsi < rsiThreshold
sellSignal = fakeoutUp and close < ma and rsi > 100 - rsiThreshold
// ترسیم سطوح حمایت و مقاومت
plot(srLevelUp, title="Resistance Level", color=color.red, linewidth=2, style=plot.style_line)
plot(srLevelDown, title="Support Level", color=color.green, linewidth=2, style=plot.style_line)
// ترسیم سیگنالهای خرید و فروش
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
// تنظیمات حد ضرر و حد سود
longStopLoss = buySignal ? close * (1 - stopLossPercent / 100) : na
shortStopLoss = sellSignal ? close * (1 + stopLossPercent / 100) : na
plot(longStopLoss, title="Long Stop Loss", color=color.green, style=plot.style_linebr)
plot(shortStopLoss, title="Short Stop Loss", color=color.red, style=plot.style_linebr)
Indicateurs et stratégies
Optimized Liquidity Squeeze IndicatorThe "Optimized Liquidity Squeeze Indicator" is designed to detect potential bullish and bearish liquidity squeezes by analyzing price wicks and EMA trends.
Key Components:
Wick Multipliers
User-defined multipliers for upper and lower wick sizes to identify significant wicks in relation to the candle body.
EMA Calculations
Uses 21-period and 50-period EMAs of the closing price to gauge trend direction.
The slope of the 21 EMA is also calculated, using a threshold to approximate a 45-degree angle.
Trend and Slope Conditions
Bullish trend if 21 EMA is above the 50 EMA, and bearish if below.
Bullish and bearish slopes are defined based on the EMA's direction and threshold.
Wick Conditions:
Bullish Upper Wick Condition
Checks for a candle with an upper wick at least a certain multiple of the body size, above the 21 EMA, with a bullish EMA slope.
Bearish Lower Wick Condition: Checks for a candle with a lower wick at least a certain multiple of the body size, below the 21 EMA, with a bearish EMA slope.
Signal Plotting and Alerts
Displays green circles above bars for bullish signals and red circles below bars for bearish signals.
Alerts are set for both bullish and bearish conditions, indicating when significant upper or lower wicks appear along with EMA slope direction.
This indicator visually highlights potential squeeze points where market liquidity may shift, aiding in trend-based entries or exits.
[Ravi] Previous Day 23:55 Candle (IST) - BTCUSDVersion 1.0
It will help you to identify the levels in 5 minutes time frame for BTCUSD.
Author:
Ravi
Motivation : ER_TRADER
MY MMEnglish Description
This TradingView Pine Script defines an indicator titled "MY SMMA," which displays two Smoothed Moving Averages (SMMA) on the price chart: one for 50 periods and another for 200 periods. Here’s a breakdown of the script’s components:
Indicator Title: The indicator is named "MY SMMA" and is set to overlay on the main price chart (with overlay=true).
Parameters:
smma50_length: Defines the length of the first SMMA at 50 periods.
smma200_length: Defines the length of the second SMMA at 200 periods.
Customizable Colors:
smma50_color: A color input option for the 50-period SMMA, set to blue by default.
smma200_color: A color input option for the 200-period SMMA, set to red by default.
Users can modify these colors through the input settings.
SMMA Calculation:
A custom function called smma is defined to calculate the smoothed moving average.
The first SMMA value is initialized to the standard SMA, and subsequent values are calculated using a weighted combination of the current price and the previous SMMA value.
Plotting:
The plot function is used to draw both SMMA lines on the chart.
The 50-period SMMA (smma50) is plotted using the user-defined smma50_color.
The 200-period SMMA (smma200) is plotted using the user-defined smma200_color.
Both lines have a default thickness (linewidth) of 1.
This indicator helps users visualize short-term and long-term trends in the market by displaying the 50-period and 200-period SMMA, which are commonly used in technical analysis to identify potential trend reversals and key support and resistance levels.
Description en Français
Ce script Pine de TradingView définit un indicateur intitulé "MY SMMA," qui affiche deux moyennes mobiles lissées (SMMA) sur le graphique des prix : une pour 50 périodes et une autre pour 200 périodes. Voici les éléments clés du script :
Titre de l'indicateur : L'indicateur est nommé "MY SMMA" et est configuré pour s'afficher directement sur le graphique des prix (avec overlay=true).
Paramètres :
smma50_length : Définit la longueur de la première SMMA à 50 périodes.
smma200_length : Définit la longueur de la seconde SMMA à 200 périodes.
Couleurs personnalisables :
smma50_color : Une option de couleur pour la SMMA de 50 périodes, définie par défaut en bleu.
smma200_color : Une option de couleur pour la SMMA de 200 périodes, définie par défaut en rouge.
L’utilisateur peut modifier ces couleurs via les paramètres d'entrée.
Calcul de la SMMA :
Une fonction personnalisée appelée smma est définie pour calculer la moyenne mobile lissée.
La première valeur de la SMMA est initialisée à la valeur de la SMA standard, et les valeurs suivantes sont calculées en utilisant une combinaison pondérée du prix actuel et de la valeur de la SMMA précédente.
Affichage des SMMA :
La fonction plot trace les deux lignes de SMMA sur le graphique.
La SMMA de 50 périodes (smma50) est tracée avec la couleur smma50_color définie par l'utilisateur.
La SMMA de 200 périodes (smma200) est tracée avec la couleur smma200_color définie par l'utilisateur.
Les deux lignes ont une épaisseur par défaut (linewidth) de 1.
Cet indicateur permet aux utilisateurs de visualiser les tendances à court et long terme sur le marché en affichant les SMMA de 50 et 200 périodes, souvent utilisées en analyse technique pour identifier les inversions de tendance potentielles ainsi que les niveaux de support et de résistance clés.
Aura Moving AveragesThe Aura Moving Averages indicator displays 5 Exponential Moving Averages (EMAs) with customizable lengths for flexible trend tracking. Default colors and line thicknesses are optimized for both short-term and long-term trend visualization, providing a clear structure for analyzing market dynamics.
Vertical Line on Custom DateThis Pine Script code creates a custom indicator for TradingView that draws a vertical line on the chart at a specific date and time defined by the user.
User Input: Allows the user to specify the day, hour, and minute when the vertical line should appear.
Vertical Line Drawing: When the current date and time match the user’s inputs, a vertical line is drawn on the chart at the corresponding bar, offset by one bar to align properly.
Customizable Color and Width: The vertical line is displayed in purple with a customizable width.
Overall, this indicator helps traders visually mark important dates and times on their price charts.
Bollinger Bands, RSI, 200 DMA, Volume and Average VolumeBollinger Bands, RSI, 200 DMA, Volume and Average Volume
EMA Crossover @mr.retailtrader1EMA Crossover Strategy
by Mr.RetailTrader
Connect with me for more strategy
YT : @mr.retailTrader1
Instagram : @mr.retailTrader1
200-Day SMA with Color Change200-Day SMA with Color Change. When price falls bellow the 200 day Moving average then the average turns red, and when the price moves above the 200 day moving average, the moving average turns gree.
MA 20, MA 50, MA 200, and Long/Sell SignalsLong Signal: A green "LONG" label appears below the bar when the price is above all three moving averages (20, 50, and 200) and there is a significant volume spike (1.5x the 20-day average volume). This indicates strong bullish momentum.
Sell Signal: A red "SELL" label appears above the bar when the price is below all three moving averages (20, 50, and 200) and the volume is high, signaling strong selling momentum and potential bearish continuation
ImbalanceDetectorLibrary "ImbalanceDetector"
detectImbalances(boxType, timeframe, showUp, showDown, showTopLine, showMiddleLine, showBottomLine, lineStyle, fillType, hideFilled, extendTilFilled, showBoxText, textType, textSize, textHAlign, textVAlign, conditionType, atrLength, atrMult, pctCond, pctMult, maxBoxes, lookbackDays, lookback, actionbool, actiondel, nmbars)
Parameters:
boxType (string)
timeframe (string)
showUp (bool)
showDown (bool)
showTopLine (bool)
showMiddleLine (bool)
showBottomLine (bool)
lineStyle (string)
fillType (string)
hideFilled (bool)
extendTilFilled (bool)
showBoxText (bool)
textType (string)
textSize (string)
textHAlign (string)
textVAlign (string)
conditionType (string)
atrLength (simple int)
atrMult (float)
pctCond (float)
pctMult (float)
maxBoxes (int)
lookbackDays (int)
lookback (bool)
actionbool (bool)
actiondel (string)
nmbars (int)
UtilLibraryLibrary "UtilLibrary"
getTablePos(pos)
Parameters:
pos (series TablePositions)
findLastLocalHigh(lookback, remainingBars)
Parameters:
lookback (int)
remainingBars (int)
findLastLocalLow(lookback, remainingBars)
Parameters:
lookback (int)
remainingBars (int)
getTrailPrice(trailSource, trailMethod, trailPercent, swingLookback, atrPeriod, atrMultiplier, positionSize, curTrailPrice)
Declare trailing price variable (stores our trail stop value)
var float trailPrice = na
Draw trailing price to chart
plot(strategy.position_size != 0 ? trailPrice : na, style = plot.style_steplinebr, color=color.red, title="Trailing Stop")
using trailPrice
if closeType == "Price Hit"
strategy.exit(id="Trail Exit", from_entry="Trade", limit=na, stop=trailPrice)
else if (strategy.position_size > 0 and close < trailPrice) or (strategy.position_size < 0 and close > trailPrice)
strategy.close("Trade")
Parameters:
trailSource (string)
trailMethod (string)
trailPercent (float)
swingLookback (int)
atrPeriod (simple int)
atrMultiplier (float)
positionSize (float)
curTrailPrice (float)
IQ Zones [TradingIQ]Hey Traders!
Introducing "IQ Zones".
"IQ Zones" is an indicator that combines support and resistance identification with volume, the "value area" of a candlestick to be exact. IQ Zones identifies turning points in the market; however, the candlestick high or low that formed the key turning point is not necessarily distinguished as the support/resistance area. Instead, the script looks into the bar at lower timeframes and calculates the value area of the candlestick that formed the support or resistance level. Therefore, any lines protruding from a candlestick reflect the value area of that candlestick. These levels (value area high and value area low) are marked on the candlestick as a support/resistance level. If the level formed on high volume it's marked as an "IQ Zone".
Additionally, IQ Zones presents a heat map to show volume intensity at nearby price areas. The heatmap is a product of the Volume Profile (IQ Profile) located on the right of the chart.
The IQ Profile is a segmented volume profile. Recent price is split into fifths (customizable), and individual volume profiles are calculated for all segmented price areas. Price is split into more than one segment to avoid a situation where volume in a ranging price zone far surpasses all other recent price areas - creating an "unusable" volume profile that doesn't offer helpful insights. If desired, you can set the segmenting option to "1" to calculate one unified volume profile for the entire price range.
The image above shows IQ Zones in action!
Core Features of IQ Zones
Value Area Support and Resistance Levels
Segmented volume profile for the recent trading period
Volume intensity heatmap
Support and resistance levels in high volume intensity may be more significant as price stoppers
The image above explains the labels marked along the y-axis of the IQ Profile.
The "more green" a price area/label is, the higher the volume intensity at the marked support/resistance area.
The image above further explains line lines protruding from the IQ Profile.
For this example, the value area of the candlestick (where most trading action occurred) is quite far from the high price of the candlestick that formed a resistance level! Using the value area of a candlestick that marks a key turning point to draw support/resistance offers insight into where the majority of trading action took place when the support/resistance level was forming!
Additionally, you can hover your mouse over the IQ Zone labels (triangles pointing up or down) to see the prices of the value area for the support/resistance level, including the total buying volume and total selling volume at the price area!
The image above further explains the IQ Profile!
You can segment the recent price area anywhere from 1 - 15 times.
The image above further explains IQ Zones and the IQ Profile!
That will be all for this indicator - a fun project to share with the community.
Thank you!
Monthly EMA Touches CounterKey Features of This Script:
Touch Threshold: The script checks if the price is within a specified percentage of each EMA.
Monthly Touch Counters: Separate counters (touchCountEMA12, touchCountEMA26, touchCountEMA50) are used to count touches for each EMA.
Reset Logic: All counters reset at the start of a new month using if ta.change(time("M")).
Increment Logic: Each counter increments whenever the corresponding EMA is touched during a bar.
Label Management: Labels are created to display each count above the bars at the end of each month.
Alert Conditions: Alerts are set up for when the price touches any of the EMAs.
Usage:
Copy and paste this script into TradingView's Pine Script editor.
Add it to your chart to see how many times the price has touched each of the EMAs (12, 26, and 50) on a monthly basis.
Adjust the Touch Threshold (%) input as needed for sensitivity.
This implementation will allow you to effectively track and visualize how often price touches each of these EMAs on a monthly basis. If you have further modifications or additional features you'd like to explore, feel free to ask
Daily Volatility Limit Channel
Hello, this is the simplest yet most powerful tool I have discovered regarding volatility. Using the ATR17 value based on a 4-hour timeframe, this tool displays the most significant volatility thresholds for the day, clearly showing when strong trends occur as these boundaries are breached. Once a boundary is crossed, the price of Bitcoin (as well as other actively traded asset classes like stocks and futures) tends to continue moving in the direction of the breakout. If the price reaches a boundary but fails to break through, this point often becomes the lowest point of pullback or correction, effectively serving as a pivot point and the optimal entry for buying.
The indicator features color and arrow options, enhancing your trading experience. The arrows appear below the candles when the trend changes to an upward impulse and above the candles when it shifts to a downward impulse. This visual aid allows traders to quickly identify trend reversals and make informed decisions.
In summary, this tool effectively highlights volatility limits and trend reversals, making it a valuable asset for any trader looking to navigate the market efficiently.
This indicator is recommended for use on 2-hour or 4-hour candlestick charts. These timeframes allow for clearer visualization of volatility and help effectively identify strong trends and volatility boundaries.
안녕하세요. 이것은 변동성에 관해 제가 발견한 것 중 가장 심플하고도 강력한 툴입니다. 4시간 기준의 ATR17값을 사용한 이 툴은 당일의 가장 강력한 변동성 한계점을 보여주며, 이 변동성 경계가 돌파될 때 강한 추세가 일어나는 것을 명확히 보여줍니다. 한 번 경계가 돌파되면 비트코인 가격(그리고 주식, 선물 등 다른 대부분의 모든 가격을 가지고 활발하게 거래되는 자산군)은 해당 돌파 쪽의 트렌드로 계속 움직이는 경향이 있습니다. 만약 가격이 경계에 도달한 채로 이 경계를 돌파하지 못할 때는 이 자리가 눌림과 조정의 최저점, 즉 피봇 포인트가 되어 매수의 최적 지점이 되는 것을 보실 수 있습니다.
지표에는 컬러 옵션과 화살표 옵션이 있어 거래 경험을 향상시킵니다. 트렌드가 상승 임펄스로 변경될 때 화살표가 캔들 아래에 나타나고, 하락 임펄스로 변경될 때는 캔들 위에 나타납니다. 이 시각적 도구는 트렌드 반전을 빠르게 식별할 수 있도록 도와주어, 거래자들이 정보에 기반한 결정을 내리는 데 유용합니다.
요약하자면, 이 툴은 변동성 한계와 트렌드 반전을 효과적으로 강조하여, 시장을 효율적으로 탐색하려는 모든 거래자에게 가치 있는 자산이 될 것입니다.
이 지표는 2시간 또는 4시간 캔들 차트에서 사용하는 것이 권장됩니다. 이러한 시간대는 지표의 변동성을 보다 명확하게 시각화하며, 강한 추세와 변동성 한계점을 효과적으로 식별하는 데 도움을 줍니다.
Z-Score RSI StrategyOverview
The Z-Score RSI Indicator is an experimental take on momentum analysis. By applying the Relative Strength Index (RSI) to a Z-score of price data, it measures how far prices deviate from their mean, scaled by standard deviation. This isn’t your traditional use of RSI, which is typically based on price data alone. Nevertheless, this unconventional approach can yield unique insights into market trends and potential reversals.
Theory and Interpretation
The RSI calculates the balance between average gains and losses over a set period, outputting values from 0 to 100. Typically, people look at the overbought or oversold levels to identify momentum extremes that might be likely to lead to a reversal. However, I’ve often found that RSI can be effective for trend-following when observing the crossover of its moving average with the midline or the crossover of the RSI with its own moving average. These crossovers can provide useful trend signals in various market conditions.
By combining RSI with a Z-score of price, this indicator estimates the relative strength of the price’s distance from its mean. Positive Z-score trends may signal a potential for higher-than-average prices in the near future (scaled by the standard deviation), while negative trends suggest the opposite. Essentially, when the Z-Score RSI indicates a trend, it reflects that the Z-score (the distance between the average and current price) is likely to continue moving in the trend’s direction. Generally, this signals a potential price movement, though it’s important to note that this could also occur if there’s a shift in the mean or standard deviation, rather than a meaningful change in price itself.
While the Z-Score RSI could be an insightful addition to a comprehensive trading system, it should be interpreted carefully. Mean shifts may validate the indicator’s predictions without necessarily indicating any notable price change, meaning it’s best used in tandem with other indicators or strategies.
Recommendations
Before putting this indicator to use, conduct thorough backtesting and avoid overfitting. The added parameters allow fine-tuning to fit various assets, but be careful not to optimize purely for the highest historical returns. Doing so may create an overly tailored strategy that performs well in backtests but fails in live markets. Keep it balanced and look for robust performance across multiple scenarios, as overfitting is likely to lead to disappointing real-world results.
Quick scan for cycles🙏🏻
The followup for
As I told before, ML based algorading is all about detecting any kind of non-randomness & exploiting it (cuz allegedly u cant trade randomness), and cycles are legit patterns that can be leveraged
But bro would u really apply Fourier / Wavelets / 'whatever else heavy' on every update of thousands of datasets, esp in real time on HFT / nearly HFT data? That's why this metric. It works much faster & eats hell of a less electicity, will do initial rough filtering of time series that might contain any kind of cyclic behaviour. And then, only on these filtered datasets u gonna put Periodograms / Autocorrelograms and see what's going there for real. Better to do it 10x times less a day on 10x less datasets, right?
I ended up with 2 methods / formulas, I called em 'type 0' and 'type 1':
- type 0: takes sum of abs deviations from drift line, scales it by max abs deviation from the same drift line;
- type 1: takes sum of abs deviations from drift line, scales it by range of non-abs deviations from the same drift line.
Finnaly I've chosen type 0 , both logically (sum of abs dev divided by max abs dev makes more sense) and experimentally. About that actually, here are both formulas put on sine waves with uniform noise:
^^ generated sine wave with uniform noise
^^ both formulas on that wave
^^ both formulas on real data
As you can see type 0 is less affected by noise and shows higher values on synthetic data, but I decided to put type 1 inside as well, in case my analysis was not complete and on real data type 1 can actually be better since it has a lil higher info gain / info content (still not sure). But I can assure u that out of all other ways I've designed & tested for quite a time I tell you, these 2 are really the only ones who got there.
Now about dem thresholds and how to use it.
Both type 0 and type 1 can be modelled with Beta distribution, and based on it and on some obvious & tho non mainstream statistical modelling techniques, I got these thresholds, so these are not optimized overfitted values, but natural ones. Each type has 3 thresholds (from lowest to highest):
- typical value (turned off by default). aka basis ;
- typical deviation from typical value, aka deviation ;
- maximum modelled deviation from typical value (idk whow to call it properly for now, this is my own R&D), aka extension .
So when the metric is above one of these thresholds (which one is up to you, you'll read about it in a sec), it means that there might be a strong enough periodic signal inside the data, and the data got to be put through proper spectral analysis tools to confirm / deny it.
If you look at the pictures above again, you'll see gray signal, that's uniform noise. Take a look at it and see where does it sit comparing to the thresholds. Now you just undertand that picking up a threshold is all about the amount of false positives you care to withstand.
If you take basis as threshold, you'll get tons of false positives (that's why it's even turned off by default), but you'll almost never miss a true positive. If you take deviation as threshold, it's gonna be kinda balanced approach. If you take extension as threshold, you gonna miss some cycles, and gonna get only the strongest ones.
More true positives -> more false positives, less false positives -> less true positives, can't go around that mane
Just to be clear again, I am not completely sure yet, but I def lean towards type 0 as metric, and deviation as threshold.
Live Long and Prosper
P.S.: That was actually the main R&D of the last month, that script I've released earlier came out as derivative.
P.S.: These 2 are the first R&Ds made completely in " art-space", St. Petersburg. Come and see me, say wassup🤘🏻
S&P 100 Option Expiration Week StrategyThe Option Expiration Week Strategy aims to capitalize on increased volatility and trading volume that often occur during the week leading up to the expiration of options on stocks in the S&P 100 index. This period, known as the option expiration week, culminates on the third Friday of each month when stock options typically expire in the U.S. During this week, investors in this strategy take a long position in S&P 100 stocks or an equivalent ETF from the Monday preceding the third Friday, holding until Friday. The strategy capitalizes on potential upward price pressures caused by increased option-related trading activity, rebalancing, and hedging practices.
The phenomenon leveraged by this strategy is well-documented in finance literature. Studies demonstrate that options expiration dates have a significant impact on stock returns, trading volume, and volatility. This effect is driven by various market dynamics, including portfolio rebalancing, delta hedging by option market makers, and the unwinding of positions by institutional investors (Stoll & Whaley, 1987; Ni, Pearson, & Poteshman, 2005). These market activities intensify near option expiration, causing price adjustments that may create short-term profitable opportunities for those aware of these patterns (Roll, Schwartz, & Subrahmanyam, 2009).
The paper by Johnson and So (2013), Returns and Option Activity over the Option-Expiration Week for S&P 100 Stocks, provides empirical evidence supporting this strategy. The study analyzes the impact of option expiration on S&P 100 stocks, showing that these stocks tend to exhibit abnormal returns and increased volume during the expiration week. The authors attribute these patterns to intensified option trading activity, where demand for hedging and arbitrage around options expiration causes temporary price adjustments.
Scientific Explanation
Research has found that option expiration weeks are marked by predictable increases in stock returns and volatility, largely due to the role of options market makers and institutional investors. Option market makers often use delta hedging to manage exposure, which requires frequent buying or selling of the underlying stock to maintain a hedged position. As expiration approaches, their activity can amplify price fluctuations. Additionally, institutional investors often roll over or unwind positions during expiration weeks, creating further demand for underlying stocks (Stoll & Whaley, 1987). This increased demand around expiration week typically leads to temporary stock price increases, offering profitable opportunities for short-term strategies.
Key Research and Bibliography
Johnson, T. C., & So, E. C. (2013). Returns and Option Activity over the Option-Expiration Week for S&P 100 Stocks. Journal of Banking and Finance, 37(11), 4226-4240.
This study specifically examines the S&P 100 stocks and demonstrates that option expiration weeks are associated with abnormal returns and trading volume due to increased activity in the options market.
Stoll, H. R., & Whaley, R. E. (1987). Program Trading and Expiration-Day Effects. Financial Analysts Journal, 43(2), 16-28.
Stoll and Whaley analyze how program trading and portfolio insurance strategies around expiration days impact stock prices, leading to temporary volatility and increased trading volume.
Ni, S. X., Pearson, N. D., & Poteshman, A. M. (2005). Stock Price Clustering on Option Expiration Dates. Journal of Financial Economics, 78(1), 49-87.
This paper investigates how option expiration dates affect stock price clustering and volume, driven by delta hedging and other option-related trading activities.
Roll, R., Schwartz, E., & Subrahmanyam, A. (2009). Options Trading Activity and Firm Valuation. Journal of Financial Markets, 12(3), 519-534.
The authors explore how options trading activity influences firm valuation, finding that higher options volume around expiration dates can lead to temporary price movements in underlying stocks.
Cao, C., & Wei, J. (2010). Option Market Liquidity and Stock Return Volatility. Journal of Financial and Quantitative Analysis, 45(2), 481-507.
This study examines the relationship between options market liquidity and stock return volatility, finding that increased liquidity needs during expiration weeks can heighten volatility, impacting stock returns.
Summary
The Option Expiration Week Strategy utilizes well-researched financial market phenomena related to option expiration. By positioning long in S&P 100 stocks or ETFs during this period, traders can potentially capture abnormal returns driven by option market dynamics. The literature suggests that options-related activities—such as delta hedging, position rollovers, and portfolio adjustments—intensify demand for underlying assets, creating short-term profit opportunities around these key dates.
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.
XAUUSD 10-Minute StrategyThis XAUUSD 10-Minute Strategy is designed for trading Gold vs. USD on a 10-minute timeframe. By combining multiple technical indicators (MACD, RSI, Bollinger Bands, and ATR), the strategy effectively captures both trend-following and reversal opportunities, with adaptive risk management for varying market volatility. This approach balances high-probability entries with robust volatility management, making it suitable for traders seeking to optimise entries during significant price movements and reversals.
Key Components and Logic:
MACD (12, 26, 9):
Generates buy signals on MACD Line crossovers above the Signal Line and sell signals on crossovers below the Signal Line, helping to capture momentum shifts.
RSI (14):
Utilizes oversold (below 35) and overbought (above 65) levels as a secondary filter to validate entries and avoid overextended price zones.
Bollinger Bands (20, 2):
Uses upper and lower Bollinger Bands to identify potential overbought and oversold conditions, aiming to enter long trades near the lower band and short trades near the upper band.
ATR-Based Stop Loss and Take Profit:
Stop Loss and Take Profit levels are dynamically set as multiples of ATR (3x for stop loss, 5x for take profit), ensuring flexibility with market volatility to optimise exit points.
Entry & Exit Conditions:
Buy Entry: T riggered when any of the following conditions are met:
MACD Line crosses above the Signal Line
RSI is oversold
Price drops below the lower Bollinger Band
Sell Entry: Triggered when any of the following conditions are met:
MACD Line crosses below the Signal Line
RSI is overbought
Price moves above the upper Bollinger Band
Exit Strategy: Trades are closed based on opposing entry signals, with adaptive spread adjustments for realistic exit points.
Backtesting Configuration & Results:
Backtesting Period: July 21, 2024, to October 30, 2024
Symbol Info: XAUUSD, 10-minute timeframe, OANDA data source
Backtesting Capital: Initial capital of $700, with each trade set to 10 contracts (equivalent to approximately 0.1 lots based on the broker’s contract size for gold).
Users should confirm their broker's contract size for gold, as this may differ. This script uses 10 contracts for backtesting purposes, aligned with 0.1 lots on brokers offering a 100-contract specification.
Key Backtesting Performance Metrics:
Net Profit: $4,733.90 USD (676.27% increase)
Total Closed Trades: 526
Win Rate: 53.99%
Profit Factor: 1.44 (1.96 for Long trades, 1.14 for Short trades)
Max Drawdown: $819.75 USD (56.33% of equity)
Sharpe Ratio: 1.726
Average Trade: $9.00 USD (0.04% of equity per trade)
This backtest reflects realistic conditions, with a spread adjustment of 38 points and no slippage or commission applied. The settings aim to simulate typical retail trading conditions. However, please adjust the initial capital, contract size, and other settings based on your account specifics for best results.
Usage:
This strategy is tuned specifically for XAUUSD on a 10-minute timeframe, ideal for both trend-following and reversal trades. The ATR-based stop loss and take profit levels adapt dynamically to market volatility, optimising entries and exits in varied conditions. To backtest this script accurately, ensure your broker’s contract specifications for gold align with the parameters used in this strategy.
Asian Session ShadingDescription
The "Asian Session Shading" indicator is designed to highlight the trading hours of the Asian market session on TradingView charts. This script shades the background of the chart in a pale blue color to visually distinguish the time period of the Asian trading session. By using this indicator, traders can easily identify when the Asian session is active, helping them to analyze and make informed trading decisions based on time-specific market behavior.
Features
Customizable Timing: The session start and end times can be adjusted to fit different Asian market hours.
Visual Clarity: The pale blue shading helps to visually separate the Asian session from other trading sessions.
Easy to Use: Simple implementation with clear visual cues on the chart.
Best Use Cases
Market Analysis: Traders can use this indicator to analyze market movements and trends specific to the Asian trading session.
Trading Strategies: This tool can assist in developing and implementing trading strategies that take into account the unique characteristics of the Asian market.
Time Management: Helps traders to manage their trading schedule by clearly marking the start and end of the Asian session.
How to Use
Apply to Chart: Save and apply the indicator to your chart to see the shaded Asian session.
This indicator is particularly useful for forex traders, stock traders, and anyone looking to incorporate the Asian market's influence into their trading strategy.
Equilibrium Candles + Pattern [Honestcowboy]The Equilibrium Candles is a very simple trend continuation or reversal strategy depending on your settings.
How an Equilibrium Candle is created:
We calculate the equilibrium by measuring the mid point between highest and lowest point over X amount of bars back.
This now is the opening price for each bar and will be considered a green bar if price closes above equilibrium.
Bars get shaded by checking if regular candle close is higher than open etc. So you still see what the normal candles are doing.
Why are they useful?
The equilibrium is calculated the same as Baseline in Ichimoku Cloud. Which provides a point where price is very likely to retrace to. This script visualises the distance between close and equilibrium using candles. To provide a clear visual of how price relates to this equilibrium point.
This also makes it more straightforward to develop strategies based on this simple concept and makes the trader purely focus on this relationship and not think of any Ichimoku Cloud theories.
Script uses a very simple pattern to enter trades:
It will count how many candles have been one directional (above or below equilibrium)
Based on user input after X candles (7 by default) script shows we are in a trend (bg colors)
On the first pullback (candle closes on other side of equilibrium) it will look to enter a trade.
Places a stop order at the high of the candle if bullish trend or reverse if bearish trend.
If based on user input after X opposite candles (2 by default) order is not filled will cancel it and look for a new trend.
Use Reverse Logic:
There is a use reverse logic in the settings which on default is turned on. It will turn long orders into short orders making the stop orders become limit orders. It will use the normal long SL as target for the short. And TP as stop for the short. This to provide a means to reverse equity curve in case your pair is mean reverting by nature instead of trending.
ATR Calculation:
Averaged ATR, which is using ta.percentile_nearest_rank of 60% of a normal ATR (14 period) over the last 200 bars. This in simple words finds a value slightly above the mean ATR value over that period.
Big Candle Exit Logic:
Using Averaged ATR the script will check if a candle closes X times that ATR from the equilibrium point. This is then considered an overextension and all trades are closed.
This is also based on user input.
Simple trade management logic:
Checks if the user has selected to use TP and SL, or/and big candle exit.
Places a TP and SL based on averaged ATR at a multiplier based on user Input.
Closes trade if there is a Big Candle Exit or an opposite direction signal from indicator.
Script can be fully automated to MT5
There are risk settings in % and symbol settings provided at the bottom of the indicator. The script will send alert to MT5 broker trying to mimic the execution that happens on tradingview. There are always delays when using a bridge to MT5 broker and there could be errors so be mindful of that. This script sends alerts in format so they can be read by tradingview.to which is a bridge between the platforms.
Use the all alert function calls feature when setting up alerts and make sure you provide the right webhook if you want to use this approach.
There is also a simple buy and sell alert feature if you don't want to fully automate but still get alerts. These are available in the dropdown when creating an alert.
Almost every setting in this indicator has a tooltip added to it. So if any setting is not clear hover over the (?) icon on the right of the setting.
The backtest uses a 4% exposure per trade and a 10 point slippage. I did not include a commission cause I'm not personaly aware what the commissions are on most forex brokers. I'm only aware of minimal slippage to use in a backtest. Trading conditions vary per broker you use so always pay close attention to trading costs on your own broker. Use a full automation at your own risk and discretion and do proper backtesting.
Economic Profit (YavuzAkbay)The Economic Profit Indicator is a Pine Script™ tool for assessing a company’s economic profit based on key financial metrics like Return on Invested Capital (ROIC) and Weighted Average Cost of Capital (WACC). This indicator is designed to give traders a more accurate understanding of risk-adjusted returns.
Features
Customizable inputs for Risk-Free Rate and Corporate Tax Rate assets for people who are trading in other countries.
Calculates Economic Profit based on ROIC and WACC, with values shown as both plots and in an on-screen table.
Provides detailed breakdowns of all key calculations, enabling deeper insights into financial performance.
How to Use
Open the stock to be analyzed. In the settings, enter the risk-free asset (usually a 10-year bond) of the country where the company to be analyzed is located. Then enter the corporate tax of the country (USCTR for the USA, DECTR for Germany). Then enter the average return of the index the stock is in. I prefer 10% (0.10) for the SP500, different rates can be entered for different indices. Finally, the beta of the stock is entered. In future versions I will automatically pull beta and index returns, but in order to publish the indicator a bit earlier, I have left it entirely up to the investor.
How to Interpret
We see 3 pieces of data on the indicator. The dark blue one is ROIC, the dark orange one is WACC and the light blue line represents the difference between WACC and ROIC.
In a scenario where both ROIC and WACC are negative, if ROIC is lower than WACC, the share is at a complete economic loss.
In a scenario where both ROIC and WACC are negative, if ROIC has started to rise above WACC and is moving towards positive, the share is still in an economic loss but tending towards profit.
A scenario where ROIC is positive and WACC is negative is the most natural scenario for a company. In this scenario, we know that the company is doing well by a gradually increasing ROIC and a stable WACC.
In addition, if the ROIC and WACC difference line goes above 0, the company is now economically in net profit. This is the best scenario for a company.
My own investment strategy as a developer of the code is to look for the moment when ROIC is greater than WACC when ROIC and WACC are negative. At that point the stock is the best time to invest.
Trading is risky, and most traders lose money. The indicators Yavuz Akbay offers are for informational and educational purposes only. All content should be considered hypothetical, selected after the facts to demonstrate my product, and not constructed as financial advice. Decisions to buy, sell, hold, or trade in securities, commodities, and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
This indicator is experimental and will always remain experimental. The indicator will be updated by Yavuz Akbay according to market conditions.