Martingale Grid BotMartingale Grid Bot (MGB)
The strategy is designed to test grid trading with a possible increase in the size of each subsequent order based on the martingale principle. The strategy itself does not contain any trade decision logic and is fully driven by external signals coming from indicators used on the chart. A new grid of orders is created when an entry signal is received, provided that there is no active grid.
❗ Warning
Trading with leverage and martingale involves increased risk. This strategy is a rather rough tool and is intended for testing purposes only. The author is not responsible for any possible discrepancies between the strategy results and real trading.
Settings
Direction - Trading direction. Possible values: Long and Short.
Entry Signal Source - Source of the entry signal that initiates the creation of a new order grid. If one of the price sources (open, high, low, close, etc.) is selected, a new grid will be created automatically after the previous grid is fully closed.
Start Time - Date and time when the strategy starts operating. Marked on the chart with a vertical dashed line.
No Repainting Mode - A mode intended to reduce discrepancies between historical and real-time strategy behavior (repainting).
Enabled — a new grid is created only after the bar is closed. The first order can be filled no earlier than on the next bar.
Disabled — in real-time, a new grid can be created immediately upon receiving a signal or after the previous grid is closed by take profit or stop loss.
❗ Attention
For correct real-time operation, recalculation on every tick must be enabled in the strategy settings.
GRID
Grid Depth % - The depth of the order grid, specified as a percentage of the closing price at the moment the grid is created.
Orders Count - The number of orders in the grid. The first order is placed at the current closing price at the time of grid creation.
Martingale Multiplier - Position size multiplier. Each subsequent order in the grid will be increased by this factor. The size of the first order is defined in the strategy settings.
Leverage - Leverage multiplier for margin trading. Used to check available funds when creating grid orders. It is recommended to use it together with the margin parameters in the strategy settings.
Take Profit % - Calculated on each strategy update based on the average entry price. If none of the grid orders have been filled yet, the take-profit level for the first order is displayed on the chart.
Stop Loss % - Calculated from the price of the first grid order and does not change during the strategy operation. Orders whose price exceeds the stop-loss level will be automatically canceled.
TABLE
Show Table - Controls the display of the table with all orders of the current grid. If there is no active grid, no order data is displayed. Text and background colors are determined automatically based on the chart background color.
Order Size - Determines how the grid order size is displayed: in contracts or in currency.
Table Size - Font size in the table.
Timezone - Used to correctly display the order fill time relative to the chart time. The order fill time (status: filled) can be seen by hovering over the corresponding status cell in the table.
VISUAL
Long Entry - Color of the dotted lines representing grid orders when trading long. Also defines the color of the vertical line indicating the strategy start time.
Short Entry - Color of the dotted lines representing grid orders when trading short. Also defines the color of the vertical line indicating the strategy start time.
Take Profit - Color of the solid line representing the take-profit level.
Stop Loss - Color of the solid line representing the stop-loss level.
Pine utilities
Pinescript Custom Performance BoostThis small script is a custom function that works similarly to the built-in calc_bars_count and max_bars_back functions, but can be used far more flexibly and significantly reduces the required computation time of Pine Script scripts.
The advantages over calc_bars_count are substantial.
The standard function works with a fixed value, e.g. calc_bars_count = 20000. The custom function, on the other hand, works on a percentage basis, e.g. with 20% of the total available chart bars.
In addition, calc_bars_count always affects the entire code, while the custom function can be applied selectively to specific parts of the script.
These two differences enable a much more flexible and efficient usage.
Fixed number of bars vs. percentage-based limitation:
The number of available bars varies greatly, not only depending on the ticker and timeframe used, but also on the TradingView subscription (approx. 5,000–40,000 historical bars).
For example, when using calc_bars_count = 20000, only charts that have more than 20,000 candles benefit. If the available number of bars is lower, there is no performance benefit at all until the value is changed after the first slow calculation.
When using the custom function with, for example, 50%, only 50% of the available bars are always calculated, regardless of how many bars are available. This results in a performance gain with shorter calculation times regardless of the chart.
Entire code vs. partial code sections:
calc_bars_count = 20000 affects the entire code globally, meaning the script processes data from only those 20,000 bars.
The custom function, however, can be used selectively for specific sections of the code. This makes it possible to continue accessing certain values across all available bars, while limiting only the truly computation-intensive parts of the script to a percentage-based range.
In this way, computation time can be drastically reduced without restricting the overall size of the data sets.
It is also possible to imitate max_bars_back and selectively limit specific values instead of limiting all of them.
I hope this is useful to some of you. Have fun with it!
SolQuant WatermarkSOLQUANT WATERMARK
The SolQuant Watermark is a professional-grade utility script designed for traders, educators, and content creators who want to keep their charts organized and branded. By utilizing Pine Script’s table functions, this indicator ensures your custom text and symbol data stay pinned to the screen, regardless of where you scroll on the price action.
KEY FEATURES
Customizable Branding: Display your community name, website, or social handles anywhere on the chart.
Automated Symbol Data: Dynamic tracking of the current Asset, Timeframe, and Date—perfect for keeping screenshots contextually accurate.
Precision Placement: Choose from 9 different anchor points (Top-Left, Bottom-Right, etc.) to ensure the UI never interferes with your technical analysis.
Visual Scaling: 5 different size settings (Tiny to Huge) to accommodate high-resolution displays or mobile viewing.
Aesthetic Control: Fully adjustable color palettes, background transparency, and border toggles.
WHY USE A TABLE-BASED WATERMARK?
Unlike standard chart labels which are tied to specific price/time coordinates, this tool uses the Table API . This means:
The watermark stays in place while you scroll through history.
It doesn't disappear when you "hide" other drawing tools.
It scales consistently across different devices.
INSTRUCTIONS
1. Branding: Open settings and type your link or handle into the "Quote Text" area.
2. Symbol Info: Toggle the "Symbol Info" section to automatically display asset names and dates for your records.
3. Layout: Use the X and Y position dropdowns to move the modules if they overlap with your current price action or other indicators.
Note: This is a visual utility tool only. It does not provide trade signals or financial advice.
Combo Premium SMA Alert SystemShort Straddle for ATM Options Entry at SMA Cross over downside and SL or Exit SMA Cross over Upside
Position Size RulerThis script is designed for day traders who need to visualize contract sizing based on stop loss size instantly without manual calculations. It bridges the gap between a trader's defined risk and the fast-moving price action of assets like NQ or MNQ.
The tool operates by creating a "position size ruler" that projects contract-specific zones based on a draggable Stop Loss anchor.
Draggable Stop Loss: In settings, you will first need to enter a value for the stop loss. This value should be near the current price value so that the ruler can be seen on your chart. Once that is done, you can click and drag the "blue dot" handle—anchored to the left edge of the stop loss—to align it with your anticipated stop loss location.
DCA + Martingale strategy.DCA + Martingale: smart synergy for volatile markets
Tame market swings with a powerful hybrid strategy that marries the discipline of Dollar‑Cost Averaging (DCA) with the aggressive recovery logic of the Martingale system. This approach turns price dips into opportunities — systematically building positions while keeping risk in check.
How it works:
1. Entry trigger
The strategy activates when the asset price drops by a predefined percentage on the 1‑hour timeframe. This ensures you only engage when a meaningful pullback occurs, avoiding premature entries.
2. DCA grid for controlled averaging
Once the entry condition is met, a grid of buy orders is deployed:
Each subsequent order is placed at progressively lower price levels (e.g., every 2–5% drop).
Order sizes can be fixed or follow a progressive scale (e.g., 1x, 1.5x, 2x the initial amount).
This dilutes your average entry price, improving the breakeven point as the market corrects.
3. Martingale‑style recovery mechanism
After each unsuccessful trade (i.e., price continues falling), the next position size is increased — not necessarily doubled, but scaled according to your risk tolerance. This accelerates recovery potential when the trend reverses.
4. Take‑profit with a fixed percentage target
A simple, predefined profit target (e.g., +3–7%) is set for the entire averaged position. Once hit, all open trades close, locking in gains. This prevents over‑exposure during uncertain reversals.
Key advantages
Psychological edge: removes emotional decision‑making by automating entries and exits.
Cost optimization: lowers average entry during downtrends, improving profit potential.
Controlled aggression: Martingale logic helps recoup losses faster without infinite scaling.
Flexibility: parameters (entry %, grid spacing, position sizing, TP) are fully customizable.
Risk management essentials
Stop‑loss safeguard: a hard stop‑loss (e.g., 10–15% below the lowest grid level) prevents catastrophic drawdowns in prolonged downtrends.
Position sizing: never risk more than 1–3% of capital per grid cycle.
Market context: best suited for assets with mean‑reverting behavior and moderate volatility. Avoid strong, sustained trends.
Capital buffer: ensure sufficient reserves to withstand multiple grid levels without margin calls.
When to use it
During sideways or range‑bound markets with regular pullbacks.
On assets with historical tendency to recover from short‑term dips.
When you expect a bounce but can’t pinpoint the exact bottom.
Bottom line
DCA + Martingale isn’t a «set‑and‑forget» miracle — it’s a disciplined framework for turning volatility into opportunity. Combine it with rigorous risk rules, and you’ll navigate downtrends with precision, turning market noise into structured profit potential.
NQ 5x Daily SessionsThis indicator automatically plots horizontal lines for the Daily Open as well as four of the most significant trading milestones of the day (CET/Berlin time). It helps you instantly identify psychological price levels and institutional opening marks directly on your chart.
Features:
Key Time Stamps: Automatic lines for the daily opening price and specific session opens at 08:00 (Frankfurt/Pre-Market), 10:00, 14:00, and 15:30 (NYSE Open).
Fully Customizable:
Control line thickness, label visibility, and the extension of current intraday lines via the settings menu.
Trading Application:
These levels often act as significant Support & Resistance during intraday trading. The 08:00 and 15:30 marks, in particular, frequently represent turning points or the start of strong trends, as trading volume spikes significantly during these windows.
SHFE vs COMEX Silver USD Spread (FX Adjusted)This indicator converts Shanghai Futures Exchange silver pricing (CNY per kilogram) into U.S. dollars per troy ounce using the live USD/CNY exchange rate. It compares the FX-adjusted Shanghai price with COMEX silver futures pricing and displays:
• Shanghai silver (converted to USD/oz)
• COMEX silver (USD/oz)
• The spread between the two markets (Shanghai − COMEX)
The tool helps visualize cross-market pricing differences and how currency movements influence silver valuation between Chinese and U.S. futures markets.
This is an analytical comparison tool and does not provide trading signals.
Notes:
• Requires access to SHFE and COMEX futures data on TradingView
• Uses USDCNY from the current chart (or selected FX symbol)
• Spread values are calculated mechanically from price and FX conversion
Volume Divergence Detector - COT EnhancedVolume Divergence Detector – COT Enhanced
This advanced indicator analyzes institutional vs retail money flow to uncover hidden market intent, focusing on Gold and Gold Futures.
Instead of relying on simple volume spikes, the script separates smart money (institutions, commercial hedgers, large speculators) from retail traders using a blend of:
Volume-based accumulation/distribution
Price momentum
RSI behavior
MACD divergence
Institutional-sized volume detection
Optional real CFTC Commitment of Traders (COT) data
The result is a dynamic money-flow model designed to expose who is truly controlling the market.
🔹 Institutional Flow Engine
Large-volume activity is tracked and converted into a smoothed institutional money line. Heavy volume is weighted more aggressively to highlight professional accumulation and distribution. When volume fades, flow naturally decays to avoid stale signals.
If enabled, weekly CFTC COT data is blended into the calculation (70% internal model, 30% real positioning), providing genuine futures-market confirmation for Gold.
Positive values indicate institutional buying.
Negative values indicate institutional selling.
🔹 Retail Flow Engine
Retail behavior is modeled using:
RSI momentum (retail follows trends)
MACD breakout behavior
Smaller volume spikes
Retail flow reacts faster and decays quicker, reflecting emotional trading and late entries. Extreme retail positioning often signals potential reversals.
🔹 Core Signals
The indicator automatically detects:
Institutional Takeover
When institutional flow crosses above retail.
Retail Takeover
When retail flow crosses above institutions (often a warning sign).
Bullish Setup
Institutions buying + retail selling.
Bearish Setup
Institutions selling + retail buying.
Extreme Divergence
Institutional and retail flows at opposite extremes. These zones often precede major reversals or powerful trend continuations.
Clear BUY / SELL labels appear directly on the chart, positioned dynamically using ATR to avoid candle overlap.
🔹 Visual Feedback
Background shading shows which side currently dominates
Extreme divergence adds special highlighting
Real-time labels display institutional and retail values
A built-in information table summarizes:
Institutional flow
Retail flow
Dominant side
Flow spread
Current signal
COT status
Everything updates live on the last bar.
🔹 Alerts Included
Custom alerts are provided for:
Institutional control
Retail control
Bullish setups
Bearish setups
Extreme divergence
Perfect for automation or hands-off monitoring.
⚠️ Important Notes
COT data works only on Gold Futures symbols.
Spot Gold uses volume-based estimation only.
Designed for directional bias and timing, not blind entries. Always confirm with structure and price action.
Created by xqweasdzxcv
A professional-grade money flow system built to follow smart capital instead of emotional traders.
Price Above VWAP FilterPrice above VWAP
this shows either a zero or one if the price is above or below the vwap
MK 1 MIN EMA 9 / EMA 21 CrossoverEMA 9 / EMA 21 Crossover Strategy (1-Minute Scalping)
This strategy is a clean, fast, and reliable EMA crossover system designed specifically for 1-minute intraday scalping.
It uses only EMA 9 and EMA 21, keeping the chart uncluttered while delivering clear BUY and SELL signals based on momentum shifts.
🔹 How It Works
BUY Signal:
When EMA 9 crosses above EMA 21, indicating bullish momentum.
SELL Signal:
When EMA 9 crosses below EMA 21, indicating bearish momentum.
Signals are confirmed visually using:
On-chart BUY / SELL text labels
Dynamic EMA color highlighting
Smart legend (top-right) that remembers the last active signal
🎨 Visual Features
EMA 9 plotted in green (turns bright on bullish trend)
EMA 21 plotted in red
BUY and SELL labels displayed directly on crossover candles
Dynamic legend:
BUY row stays green after bullish cross
SELL row stays red after bearish cross
Makes trend direction instantly clear, even on fast charts
⏱ Best Use
Timeframe: 1-minute
Suitable for:
Index scalping
Options scalping
High-liquidity stocks & ETFs
Works best during high-volume market hours
Straddle Premium TrackerStraddle Premium Trackefr is used to combine CALL and PUT of premiums of same strike price
ARX Killzone Session Flags (UK)This script provides minimal session time flags for London and New York, designed to offer time-based context only.
It marks the start and end of predefined session windows using small, non-intrusive labels directly on the chart.
The script automatically adjusts for UK daylight saving time (GMT / BST) using the Europe/London timezone, requiring no manual changes throughout the year.
This tool does not generate trade signals, does not analyse price, and does not provide execution guidance.
Educational and contextual use only.
Not financial advice.
Universe_PRMP (Universe_Professional Risk Management Panel)Description
Universe_PRMP (Universe_Professional Risk Management Panel)
This comprehensive tool is designed to bring institutional-grade risk discipline to retail traders. Managing risk is the most critical part of trading, especially in high-leverage environments. This script automates the complex calculations of position sizing and profit/loss projection.
How to Use:
Initial Setup: When you add the script to your chart, it will prompt you to select two price levels. The first click sets your Stop Loss (SL) and the second sets your Take Profit (TP).
Account Configuration: Open the script settings (the gear icon) to input your Account Balance and the Percentage of Risk you are willing to take per trade (standard is 1% or 2%).
Market Conditions: Enter your broker's current Spread in pips to ensure the lot size calculation accounts for the cost of entry.
Active Monitoring:
Suggested Lot: The dashboard will immediately show the exact lot size you should enter in your trading platform.
Real-Time Projection: As price moves, the dashboard tracks whether your trade is active, hit the target, or stopped out.
Visual Labels: Red (SL) and Green (TP) labels on the chart provide clear visual cues for your exit points.
Key Features:
Dynamic Position Sizing: Automatically adjusts lot size based on the distance between entry and SL.
Spread Integration: Protects your capital by including transaction costs in the risk calculation.
Ticker Sensitivity: The panel recognizes symbol changes to prevent calculation errors across different pairs.
Visual Status Indicators: Color-coded status alerts to keep you emotionally detached and strategically focused.
DISCLAIMER:
This script is an educational and utility tool designed for risk calculation purposes only. It does not provide trading signals or investment advice. Past performance is not indicative of future results. Use this tool at your own risk.
Weekly Bias - High/Low/Close (Clean No Connections)Gives you the weekly bias candle on your 4 hour closing NY trading hours
ARX | Time Window Box AsiaThis script displays a visual time window box on the chart to represent a predefined Asia session time range.
It is a visual and organizational utility only. The script does not analyze price, generate signals, issue alerts, or provide any form of trading guidance.
Its sole purpose is to help users visually identify time periods on a chart.
Educational and organizational use only. Not financial advice.
ARX | Chart Watermark Utility This script adds a simple visual watermark or label to the chart for identification and presentation purposes.
It does not generate signals, alerts, predictions, or trading logic, and does not analyze price data.
The tool is intended purely as a visual utility to help users organize and brand their charts.
Educational and organizational use only. Not financial advice.
FDAX Session Levels (Daily open, 10:00, 14:00)Automated intraday levels for FDAX/DAX traders based on the Europe/Berlin timezone
Monitored Levels:
Daily Open (DO): Midnight open price (00:00 CET).
08:00 CET: Frankfurt session start.
10:00 CET: Morning trend establishment.
14:00 CET: Pre-US session liquidity shift.
Visibility: Clearly labeled levels with adjustable line thickness (Width 3).
Extend Logic: Toggle between infinite lines or session-only historical views.
Precision: Synced with Eurex trading hours.
Ideal for: Identifying intraday Support/Resistance and S/R flips on 1m to 15m timeframes.
Weekly open line + SeparatorA toolkit to organize your chart by weekly vertical separation and the weekly horizontal line for support and resistance on H1 charts.
Key Features:
Weekly Open Line (WOL):
Automatically plots a clean horizontal line at each week's opening price (CET/Berlin Time).
Selective Extension:
Want to track a major historical level? Select any past week via the calendar and extend its WOL infinitely to the right for S/R analysis.
Vertical Session Breaks:
Distinct dashed lines for new weeks and months to provide instant structural clarity.
Smart Labels:
Displays English Month names (Jan, Feb...) and Week numbers (W1, W2...)
Fully Customizable:
Adjust colors, visibility, and line widths for all elements independently in the settings.
Time Anchored FX LevelFX-Anchored Price Level
This indicator anchors a historical price at a specific date and time, and optionally links that anchor to a secondary FX rate to create a dynamic, currency-aware price level.
Thus, e.g. one visualize a past BTCEUR price on a BTCUSD chart now.
At the selected timestamp, the script captures the chart price using the chosen timeframe and price source.
If a secondary ticker is provided (for example, an FX rate), the anchored value is fixed in that secondary currency and then converted back to the chart currency on every bar. The result is a moving level that reflects changes in the exchange rate over time.
If no secondary ticker is set, the indicator behaves as a classic time-anchored price level and plots a constant historical price.
Key features
* Anchor a price to an exact date and time (string input with optional hour offset)
* Optional secondary ticker for FX or cross-rate conversion
* Dynamic level plotted as a series (updates like a moving average)
* User-selectable calculation timeframe and price source (Open, Close, etc.)
* Visual anchor marker at the original timestamp
* Last-bar price label for clear readability
Typical use cases
* FX buyback or re-entry levels after converting proceeds into another currency
* Evaluating historical prices in constant-currency terms
* Comparing past executions to current market conditions
* Anchoring risk or valuation levels across time and exchange rates
This tool is designed for traders who need precise, time-anchored reference levels that remain meaningful as currencies and markets evolve.
Weekly + Monthly Vertical Separator + LabelsA visual aid to organize your chart into clear time-based sections.
Vertical Dividers:
Distinct dashed lines for both new weeks and months.
Smart Labels:
Displays the Month name (Jan, Feb, etc.) and the Week number (W1, W2, etc.) at the top of the chart.
Hierarchy Logic:
Monthly indicators take priority to keep the chart clean.
CET/Berlin Time:
Perfectly synced for traders following European market sessions.






















