Dskyz (DAFE) Quantum Sentiment Flux - Beginners Dskyz (DAFE) Quantum Sentiment Flux - Beginners:
Welcome to the Dskyz (DAFE) Quantum Sentiment Flux - Beginners , a strategy and concept that’s your ultimate wingman for trading futures like MNQ, NQ, MES, and ES. This gem combines lightning-fast momentum signals, market sentiment smarts, and bulletproof risk management into a system so intuitive, even newbies can trade like pros. With clean DAFE visuals, preset modes for every vibe, and a revamped dashboard that’s basically a market GPS, this strategy makes futures trading feel like a high-octane sci-fi mission.
Built on the Dskyz (DAFE) legacy of Aurora Divergence, the Quantum Sentiment Flux is designed to empower beginners while giving seasoned traders a lean, sentiment-driven edge. It uses fast/slow EMA crossovers for entries, filters trades with VIX, SPX trends, and sector breadth, and keeps your account safe with adaptive stops and cooldowns. Tuned for more action with faster signals and a slick bottom-left dashboard, this updated version is ready to light up your charts and outsmart institutional traps. Let’s dive into why this strat’s a must-have and break down its brilliance.
Why Traders Need This Strategy
Futures markets are a wild ride—fast moves, volatility spikes (like the April 28, 2025 NQ 1k-point drop), and institutional games that can wreck unprepared traders. Beginners often get lost in complex systems or burned by impulsive trades. The Quantum Sentiment Flux is the antidote, offering:
Dead-Simple Setup: Preset modes (Aggressive, Balanced, Conservative) auto-tune signals, risk, and sizing, so you can trade without a quant degree.
Sentiment Superpower: VIX filter, SPX trend, and sector breadth visuals keep you aligned with market health, dodging chop and riding trends.
Ironclad Safety: Tighter ATR-based stops, 2:1 take-profits, and preset cooldowns protect your capital, even in chaotic sessions.
Next-Level Visuals: Green/red entry triangles, vibrant EMAs, a sector breadth background, and a beefed-up dashboard make signals and context pop.
DAFE Swagger: The clean aesthetics, sleek dashboard—ties it to Dskyz’s elite brand, making your charts a work of art.
Traders need this because it’s a plug-and-play system that blends beginner-friendly simplicity with pro-level market awareness. Whether you’re just starting or scalping 5min MNQ, this strat’s your key to trading with confidence and style.
Strategy Components
1. Core Signal Logic (High-Speed Momentum)
The strategy’s engine is a momentum-based system using fast and slow Exponential Moving Averages (EMAs), now tuned for faster, more frequent trades.
How It Works:
Fast/Slow EMAs: Fast EMA (Aggressive: 5, Balanced: 7, Conservative: 9 bars) and slow EMA (12/14/18 bars) track short-term vs. longer-term momentum.
Crossover Signals:
Buy: Fast EMA crosses above slow EMA, and trend_dir = 1 (fast EMA > slow EMA + ATR * strength threshold).
Sell: Fast EMA crosses below slow EMA, and trend_dir = -1 (fast EMA < slow EMA - ATR * strength threshold).
Strength Filter: ma_strength = fast EMA - slow EMA must exceed an ATR-scaled threshold (Aggressive: 0.15, Balanced: 0.18, Conservative: 0.25) for robust signals.
Trend Direction: trend_dir confirms momentum, filtering out weak crossovers in choppy markets.
Evolution:
Faster EMAs (down from 7–10/21–50) catch short-term trends, perfect for active futures markets.
Lower strength thresholds (0.15–0.25 vs. 0.3–0.5) make signals more sensitive, boosting trade frequency without sacrificing quality.
Preset tuning ensures beginners get optimized settings, while pros can tweak via mode selection.
2. Market Sentiment Filters
The strategy leans hard into market sentiment with a VIX filter, SPX trend analysis, and sector breadth visuals, keeping trades aligned with the big picture.
VIX Filter:
Logic: Blocks long entries if VIX > threshold (default: 20, can_long = vix_close < vix_limit). Shorts are always allowed (can_short = true).
Impact: Prevents longs during high-fear markets (e.g., VIX spikes in crashes), while allowing shorts to capitalize on downturns.
SPX Trend Filter:
Logic: Compares S&P 500 (SPX) close to its SMA (Aggressive: 5, Balanced: 8, Conservative: 12 bars). spx_trend = 1 (UP) if close > SMA, -1 (DOWN) if < SMA, 0 (FLAT) if neutral.
Impact: Provides dashboard context, encouraging trades that align with market direction (e.g., longs in UP trend).
Sector Breadth (Visual):
Logic: Tracks 10 sector ETFs (XLK, XLF, XLE, etc.) vs. their SMAs (same lengths as SPX). Each sector scores +1 (bullish), -1 (bearish), or 0 (neutral), summed as breadth (-10 to +10).
Display: Green background if breadth > 4, red if breadth < -4, else neutral. Dashboard shows sector trends (↑/↓/-).
Impact: Faster SMA lengths make breadth more responsive, reflecting sector rotations (e.g., tech surging, energy lagging).
Why It’s Brilliant:
- VIX filter adds pro-level volatility awareness, saving beginners from panic-driven losses.
- SPX and sector breadth give a 360° view of market health, boosting signal confidence (e.g., green BG + buy signal = high-probability trade).
- Shorter SMAs make sentiment visuals react faster, perfect for 5min charts.
3. Risk Management
The risk controls are a fortress, now tighter and more dynamic to support frequent trading while keeping accounts safe.
Preset-Based Risk:
Aggressive: Fast EMAs (5/12), tight stops (1.1x ATR), 1-bar cooldown. High trade frequency, higher risk.
Balanced: EMAs (7/14), 1.2x ATR stops, 1-bar cooldown. Versatile for most traders.
Conservative: EMAs (9/18), 1.3x ATR stops, 2-bar cooldown. Safer, fewer trades.
Impact: Auto-scales risk to match style, making it foolproof for beginners.
Adaptive Stops and Take-Profits:
Logic: Stops = entry ± ATR * atr_mult (1.1–1.3x, down from 1.2–2.0x). Take-profits = entry ± ATR * take_mult (2x stop distance, 2:1 reward/risk). Longs: stop below entry, TP above; shorts: vice versa.
Impact: Tighter stops increase trade turnover while maintaining solid risk/reward, adapting to volatility.
Trade Cooldown:
Logic: Preset-driven (Aggressive/Balanced: 1 bar, Conservative: 2 bars vs. old user-input 2). Ensures bar_index - last_trade_bar >= cooldown.
Impact: Faster cooldowns (especially Aggressive/Balanced) allow more trades, balanced by VIX and strength filters.
Contract Sizing:
Logic: User sets contracts (default: 1, max: 10), no preset cap (unlike old 7/5/3 suggestion).
Impact: Flexible but risks over-leverage; beginners should stick to low contracts.
Built To Be Reliable and Consistent:
- Tighter stops and faster cooldowns make it a high-octane system without blowing up accounts.
- Preset-driven risk removes guesswork, letting newbies trade confidently.
- 2:1 TPs ensure profitable trades outweigh losses, even in volatile sessions like April 27, 2025 ES slippage.
4. Trade Entry and Exit Logic
The entry/exit rules are simple yet razor-sharp, now with VIX filtering and faster signals:
Entry Conditions:
Long Entry: buy_signal (fast EMA crosses above slow EMA, trend_dir = 1), no position (strategy.position_size = 0), cooldown passed (can_trade), and VIX < 20 (can_long). Enters with user-defined contracts.
Short Entry: sell_signal (fast EMA crosses below slow EMA, trend_dir = -1), no position, cooldown passed, can_short (always true).
Logic: Tracks last_entry_bar for visuals, last_trade_bar for cooldowns.
Exit Conditions:
Stop-Loss/Take-Profit: ATR-based stops (1.1–1.3x) and TPs (2x stop distance). Longs exit if price hits stop (below) or TP (above); shorts vice versa.
No Other Exits: Keeps it straightforward, relying on stops/TPs.
5. DAFE Visuals
The visuals are pure DAFE magic, blending clean function with informative metrics utilized by professionals, now enhanced by faster signals and a responsive breadth background:
EMA Plots:
Display: Fast EMA (blue, 2px), slow EMA (orange, 2px), using faster lengths (5–9/12–18).
Purpose: Highlights momentum shifts, with crossovers signaling entries.
Sector Breadth Background:
Display: Green (90% transparent) if breadth > 4, red (90%) if breadth < -4, else neutral.
Purpose: Faster breadth_sma_len (5–12 vs. 10–50) reflects sector shifts in real-time, reinforcing signal strength.
- Visuals are intuitive, turning complex signals into clear buy/sell cues.
- Faster breadth background reacts to market rotations (e.g., tech vs. energy), giving a pro-level edge.
6. Sector Breadth Dashboard
The new bottom-left dashboard is a game-changer, a 3x16 table (black/gray theme) that’s your market command center:
Metrics:
VIX: Current VIX (red if > 20, gray if not).
SPX: Trend as “UP” (green), “DOWN” (red), or “FLAT” (gray).
Trade Longs: “OK” (green) if VIX < 20, “BLOCK” (red) if not.
Sector Breadth: 10 sectors (Tech, Financial, etc.) with trend arrows (↑ green, ↓ red, - gray).
Placeholder Row: Empty for future metrics (e.g., ATR, breadth score).
Purpose: Consolidates regime, volatility, market trend, and sector data, making decisions a breeze.
- VIX and SPX metrics add context, helping beginners avoid bad trades (e.g., no longs if “BLOCK”).
Sector arrows show market health at a glance, like a cheat code for sentiment.
Key Features
Beginner-Ready: Preset modes and clear visuals make futures trading a breeze.
Sentiment-Driven: VIX filter, SPX trend, and sector breadth keep you in sync with the market.
High-Frequency: Faster EMAs, tighter stops, and short cooldowns boost trade volume.
Safe and Smart: Adaptive stops/TPs and cooldowns protect capital while maximizing wins.
Visual Mastery: DAFE’s clean flair, EMAs, dashboard—makes trading fun and clear.
Backtestable: Lean code and fixed qty ensure accurate historical testing.
How to Use
Add to Chart: Load on a 5min MNQ/ES chart in TradingView.
Pick Preset: Aggressive (scalping), Balanced (versatile), or Conservative (safe). Balanced is default.
Set Contracts: Default 1, max 10. Stick low for safety.
Check Dashboard: Bottom-left shows preset, VIX, SPX, and sectors. “OK” + green breadth = strong buy.
Backtest: Run in strategy tester to compare modes.
Live Trade: Connect to Tradovate or similar. Watch for slippage (e.g., April 27, 2025 ES issues).
Replay Test: Try April 28, 2025 NQ drop to see VIX filter and stops in action.
Why It’s Brilliant
The Dskyz (DAFE) Quantum Sentiment Flux - Beginners is a masterpiece of simplicity and power. It takes pro-level tools—momentum, VIX, sector breadth—and wraps them in a system anyone can run. Faster signals and tighter stops make it a trading machine, while the VIX filter and dashboard keep you ahead of market chaos. The DAFE visuals and bottom-left command center turn your chart into a futuristic cockpit, guiding you through every trade. For beginners, it’s a safe entry to futures; for pros, it’s a scalping beast with sentiment smarts. This strat doesn’t just trade—it transforms how you see the market.
Final Notes
This is more than a strategy—it’s your launchpad to mastering futures with Dskyz (DAFE) flair. The Quantum Sentiment Flux blends accessibility, speed, and market savvy to help you outsmart the game. Load it, watch those triangles glow, and let’s make the markets your canvas!
Official Statement from Pine Script Team
(see TradingView help docs and forums):
"This warning may appear when you call functions such as ta.sma inside a request.security in a loop. There is no runtime impact. If you need to loop through a dynamic list of tickers, this cannot be avoided in the present version... Values will still be correct. Ignore this warning in such contexts."
(This publishing will most likely be taken down do to some miscellaneous rule about properly displaying charting symbols, or whatever. Once I've identified what part of the publishing they want to pick on, I'll adjust and repost.)
Use it with discipline. Use it with clarity. Trade smarter.
**I will continue to release incredible strategies and indicators until I turn this into a brand or until someone offers me a contract.
Created by Dskyz, powered by DAFE Trading Systems. Trade fast, trade bold.
Cerca negli script per "profit"
Slark Signal XtremeStrategy Description: Slark Signal Xtreme
The Slark Signal Xtreme is an innovative trading strategy designed to identify and capitalize on market opportunities by leveraging pivots, trend breakouts, and dynamic risk management. This strategy combines day-of-week and time filters with a ticks-based Stop Loss (SL) and Take Profit (TP) system, delivering customized signals and real-time alerts. Ideal for traders seeking a structured and highly customizable approach, Slark Signal Xtreme also incorporates advanced visual tools for efficient trade management.
Key Features:
Pivot- and Breakout-Based Signals: Utilizes pivot detection (highs/lows) combined with an ATR-based slope calculation to pinpoint trend changes and potential entry or exit points.
Dynamic Stop-Loss (SL) and Take-Profit (TP) Levels: Automatically calculates SL and TP based on the entry price and user-defined tick settings, adapting to volatility and optimizing risk management.
Time and Day Filters: Allows you to select specific days of the week and trading sessions during which signals are generated, avoiding low-liquidity periods or unwanted high volatility.
Customizable Risk Management: Lets you define the number of ticks for SL and TP, trading hours, initial capital, pyramiding, and commissions, tailoring the strategy to various risk profiles and assets.
Enhanced Visualization:
- SL and TP Boxes: Displays rectangular boxes on the chart indicating SL and TP levels, streamlining trade management.
- Candle Color Changes: Candles can be colored according to price position relative to pivot lines (bullish, bearish, or neutral).
- Session Highlight: Shades the chart background during the selected trading hours, providing immediate context on when the strategy is active.
Automated Alerts: Generates customizable alerts in TradingView whenever a buy or sell signal is triggered, detailing the timing, instrument, and SL/TP levels.
How the Strategy Works:
Technical Indicator Calculations:
- Pivot High/Low and Slope: Identifies price pivot points and calculates slope (based on ATR) to measure trend strength.
- Time and Day Filters: Signals only trigger within the specified days and hours, helping avoid undesirable market conditions.
Generating Buy and Sell Signals:
- Buy Signal (Long): Activated when price breaks above a downward pivot-based trendline or meets the condition for higher pivots.
- Sell Signal (Short): Activated when price breaks below an upward pivot-based trendline or meets the condition for lower pivots.
- Operation Conditions: Signals are only generated on selected days and during chosen trading hours, avoiding periods of low liquidity or excessive volatility.
Dynamic SL and TP Calculation:
- Stop-Loss (SL) and Take-Profit (TP): Determined by the entry price ± a user-defined number of ticks.
- SL and TP Visualization: Boxes are drawn on the chart from the entry price to SL/TP levels, enabling clear visual reference for trade management.
Order Execution and Alerts:
- Order Execution: When a signal is generated, Slark Signal Xtreme automatically opens a long or short position in TradingView’s backtesting environment.
- Alerts: Customizable alerts can be set up to provide real-time notifications (via TradingView or third-party integrations), offering essential details like instrument, time, SL/TP, etc.
Trade Management and Monitoring:
- Automatic Closure: Each trade is automatically closed upon reaching its SL or TP, ensuring disciplined risk control.
- Trade Summary: TradingView’s built-in reporting tools list all trades with cumulative results, simplifying performance evaluation.
Additional Visualization:
- Candle Coloring by Trend: Candles can be colored bullish, bearish, or neutral based on the pivot-driven trend detection.
- Operational Range Highlighting: The chart background is shaded during the permitted trading hours, clarifying when the strategy is active and enhancing visibility.
---
Strategy Properties (Important)
This backtest was conducted in TradingView under the following configuration:
Initial Capital: 1000 USD
Order Size: 10,000 contracts (adjust according to the traded asset)
Commission: 0.05 USD per order
Slippage: 1 tick
Pyramiding: 1 order
Price Verification for Limit Orders: 0 ticks
Recalculate on Every Tick & On Bar Close: Enabled
Bar Magnifier for Backtesting Precision: Enabled
These properties provide a realistic view of the strategy’s performance. However, default parameters may vary depending on each user or market:
Order Size: Should be calculated according to the asset traded and your desired risk level.
Commission and Slippage: Costs can vary by market and instrument; there is no universal default that guarantees realistic results.
All users are strongly recommended to adjust these properties within the script settings to match their own trading accounts and platforms, ensuring the most accurate backtest results.
---
Backtesting Results:
- Net Profit: +28.70
- Total Trades: 397
- Winning Trades: 138
- Win Rate: 34.76%
- Profit Factor: 1.07
- Sharpe Ratio: 1.25
- Sortino Ratio: 1.45
- Average Bars per Trade: 24
- Average Profit per Trade: 1.45
These numbers provide an overview of the strategy’s historical performance, demonstrating its potential for profitability given appropriate risk management.
---
Interpretation of Results:
- The strategy can be profitable despite a relatively modest win rate, thanks to a suitable risk-reward ratio.
- A profit factor of 1.07 indicates that total profits slightly exceed total losses.
- It is essential to monitor drawdown and ensure it aligns with your personal risk tolerance.
---
Risk Warning:
Trading leveraged financial instruments carries a high level of risk and may not be suitable for all investors. Before trading, carefully consider your investment objectives, experience level, and risk tolerance. Past performance does not guarantee future results. Always perform additional testing and adjust the strategy to your specific needs.
---
What Makes This Strategy Original?
Focus on Pivots and Time/Day Filters: Rather than purely relying on momentum indicators, Slark Signal Xtreme uses pivot-based signals and scheduling filters to capture higher-liquidity, directional market moves.
Dynamic Risk Management: Ticks-based SL/TP and customizable trading sessions enable precise adaptation to various markets and trading styles.
Advanced Visualization Tools: SL/TP boxes, candle coloring, and session highlights streamline market interpretation and facilitate real-time decision-making.
Seamless Alert Integration: Although native TradingView alerts are provided, it can be integrated with third-party messaging services (Telegram, Discord, etc.) for enhanced automation.
---
Additional Considerations
Continuous Testing and Optimization: Regularly backtest and fine-tune parameters (SL, TP, time filters, etc.) to accommodate changing market conditions.
Complementary Analysis: Combine this strategy with other technical or fundamental tools to confirm signals.
Rigorous Risk Management: Ensure SL/TP levels and position sizes conform to your overall risk management plan.
Updates and Support: Future updates and improvements may be released based on community feedback. For questions or suggestions, feel free to reach out.
---
Example Configuration
Assume you want to run Slark Signal Xtreme with these settings:
Trading Days: Monday to Friday
Trading Hours: 8:00 to 11:00 (exchange or broker time)
Stop Loss (SL) in Ticks: 100
Take Profit (TP) in Ticks: 300
SL/TP Box Extension: 20 bars
Initial Capital: 1000 USD
Risk per Trade: 1% of capital
Commissions & Slippage: 0.05 USD commission, 1 tick slippage
---
Conclusion
The Slark Signal Xtreme strategy delivers a robust and adaptable solution by merging pivots, time/day filters, flexible risk parameters, and advanced visualization. Its distinctive and customizable design makes it a powerful resource for traders aiming to diversify their methods and exploit trend breakouts under specific conditions. Fully compatible with TradingView, Slark Signal Xtreme can enhance your trading toolkit and foster a more systematic approach to your operations.
---
Final Disclaimer:
Financial markets are inherently volatile and pose significant risks. This strategy should be employed as part of a comprehensive trading plan and does not guarantee positive outcomes. Always consult a qualified financial advisor before making investment decisions. The use of Slark Signal Xtreme is solely at the user’s discretion, who must evaluate personal risk tolerance and financial objectives.
[3Commas] HA & MAHA & MA
🔷What it does: This tool is designed to test a trend-following strategy using Heikin Ashi candles and moving averages. It enters trades after pullbacks, aiming to let profits run once the risk-to-reward ratio reaches 1:1 while securing the position.
🔷Who is it for: It is ideal for traders looking to compare final results using fixed versus dynamic take profits by adjusting parameters and trade direction—a concept applicable to most trading strategies.
🔷How does it work: We use moving averages to define the market trend, then wait for opposite Heikin Ashi candles to form against it. Once these candles reverse in favor of the trend, we enter the trade, using the last swing created by the pullback as the stop loss. By applying the breakeven ratio, we protect the trade and let it run, using the slower moving average as a trailing stop.
A buy signal is generated when:
The previous candle is bearish (ha_bear ), indicating a pullback.
The fast moving average (ma1) is above the slow moving average (ma2), confirming an uptrend.
The current candle is bullish (ha_bull), showing trend continuation.
The Heikin Ashi close is above the fast moving average (ma1), reinforcing the bullish bias.
The real price close is above the open (close > open), ensuring bullish momentum in actual price data.
The signal is confirmed on the closed candle (barstate.isconfirmed) to avoid premature signals.
dir is undefined (na(dir)), preventing repeated signals in the same direction.
A sell signal is generated when:
The previous candle is bullish (ha_bull ), indicating a temporary upward move before a potential reversal.
The fast moving average (ma1) is below the slow moving average (ma2), confirming a downtrend.
The current candle is bearish (ha_bear), showing trend continuation to the downside.
The Heikin Ashi close is below the fast moving average (ma1), reinforcing bearish pressure.
The real price close is below the open (close < open), confirming bearish momentum in actual price data.
The signal is confirmed after the candle closes (barstate.isconfirmed), avoiding premature entries.
dir is undefined (na(dir)), preventing consecutive signals in the same direction.
In simple terms, this setup looks for trend continuation after a pullback, confirming entries with both Heikin Ashi and real price action, supported by moving average alignment to avoid false signals.
If the price reaches a 1:1 risk-to-reward ratio, the stop will be moved to the entry point. However, if the slow moving average surpasses this level, it will become the new exit point, acting as a trailing stop
🔷Why It’s Unique
Easily visualizes the benefits of using risk-to-reward ratios when trading instead of fixed percentages.
Provides a simple and straightforward approach to trading, embracing the "keep it simple" concept.
Offers clear visualization of DCA Bot entry and exit points based on user preferences.
Includes an option to review the message format before sending signals to bots, with compatibility for multi-pair and futures contract pairs.
🔷 Considerations Before Using the Indicator
⚠️Very important: The indicator must be used on charts with real price data, such as Japanese candlesticks, line charts, etc. Do not use it on Heikin Ashi charts, as this may lead to unrealistic results.
🔸Since this is a trend-following strategy, use it on timeframes above 4 hours, where market noise is reduced and trends are clearer. Also, carefully review the statistics before using it, focusing on pairs that tend to have long periods of well-defined trends.
🔸Disadvantages:
False Signals in Ranges: Consolidating markets can generate unreliable signals.
Lagging Indicator: Being based on moving averages, it may react late to sudden price movements.
🔸Advantages:
Trend Focused: Simplifies the identification of trending markets.
Noise Reduction: Uses Heikin Ashi candles to identify trend continuation after pullbacks.
Broad Applicability: Suitable for forex, crypto, stocks, and commodities.
🔸The strategy provides a systematic way to analyze markets but does not guarantee successful outcomes. Use it as an additional tool rather than relying solely on an automated system.
Trading results depend on various factors, including market conditions, trader discipline, and risk management. Past performance does not ensure future success, so always approach the market cautiously.
🔸Risk Management: Define stop-loss levels, position sizes, and profit targets before entering any trade. Be prepared for potential losses and ensure your approach aligns with your overall trading plan.
🔷 STRATEGY PROPERTIES
Symbol: BINANCE:BTCUSDT (Spot).
Timeframe: 4h.
Test Period: All historical data available.
Initial Capital: 10000 USDT.
Order Size per Trade: 1% of Capital, you can use a higher value e.g. 5%, be cautious that the Max Drawdown does not exceed 10%, as it would indicate a very risky trading approach.
Commission: Binance commission 0.1%, adjust according to the exchange being used, lower numbers will generate unrealistic results. By using low values e.g. 5%, it allows us to adapt over time and check the functioning of the strategy.
Slippage: 5 ticks, for pairs with low liquidity or very large orders, this number should be increased as the order may not be filled at the desired level.
Margin for Long and Short Positions: 100%.
Indicator Settings: Default Configuration.
MA1 Length: 9.
MA2 Length: 18.
MA Calculations: EMA.
Take Profit Ratio: Disable. Ratio 1:4.
Breakeven Ratio: Enable, Ratio 1:1.
Strategy: Long & Short.
🔷 STRATEGY RESULTS
⚠️Remember, past results do not guarantee future performance.
Net Profit: +324.88 USDT (+3.25%).
Max Drawdown: -81.18 USDT (-0.78%).
Total Closed Trades: 672.
Percent Profitable: 35.57%.
Profit Factor: 1.347.
Average Trade: +0.48 USDT (+0.48%).
Average # Bars in Trades: 13.
🔷 HOW TO USE
🔸 Adjust Settings:
The default values—MA1 (9) and MA2 (18) with EMA calculation—generally work well. However, you can increase these values, such as 20 and 40, to better identify stronger trends.
🔸 Choose a Symbol that Typically Trends:
Select an asset that tends to form clear trends. Keep in mind that the Strategy Tester results may show poor performance for certain assets, making them less suitable for sending signals to bots.
🔸 Experiment with Ratios:
Test different take profit and breakeven ratios to compare various scenarios—especially to observe how the strategy performs when only the trade is protected.
🔸This is an example of how protecting the trade works: once the price moves in favor of the position with a 1:1 risk-to-reward ratio, the stop loss is moved to the entry price. If the Slow MA surpasses this level, it will act as a trailing stop, aiming to follow the trend and maximize potential gains.
🔸In contrast, in this example, for the same trade, if we set a take profit at a 1:3 risk-to-reward ratio—which is generally considered a good risk-reward relationship—we can see how a significant portion of the upward move is left on the table.
🔸Results Review:
It is important to check the Max Drawdown. This value should ideally not exceed 10% of your capital. Consider adjusting the trade size to ensure this threshold is not surpassed.
Remember to include the correct values for commission and slippage according to the symbol and exchange where you are conducting the tests. Otherwise, the results will not be realistic.
If you are satisfied with the results, you may consider automating your trades. However, it is strongly recommended to use a small amount of capital or a demo account to test proper execution before committing real funds.
🔸Create alerts to trigger the DCA Bot:
Verify Messages: Ensure the message matches the one specified by the DCA Bot.
Multi-Pair Configuration: For multi-pair setups, enable the option to add the symbol in the correct format.
Signal Settings: Enable whether you want to receive long or short signals (Entry | TP | SL), copy and paste the the messages for the DCA Bots configured.
Alert Setup:
When creating an alert, set the condition to the indicator and choose "alert() function call only.
Enter any desired Alert Name.
Open the Notifications tab, enable Webhook URL, and paste the Webhook URL.
For more details, refer to the section: "How to use TradingView Custom Signals".
Finalize Alerts: Click Create, you're done! Alerts will now be sent automatically in the correct format.
🔷 INDICATOR SETTINGS
MA 1: Fast MA Length
MA 2: Slow MA Length
MA Calc: MA's Calculations (SMA,EMA, RMA,WMA)
TP Ratio: This is the take profit ratio relative to the stop loss, where the trade will be closed in profit.
BE Ratio: This is the breakeven ratio relative to the stop loss, where the stop loss will be updated to breakeven or if the MA2 is greater than this level.
Strategy: Order Type direction in which trades are executed.
Use Custom Test Period: When enabled signals only works in the selected time window. If disabled it will use all historical data available on the chart.
Test Start and End: Once the Custom Test Period is enabled, here you select the start and end date that you want to analyze.
Check Messages: Enable the table to review the messages to be sent to the bot.
Entry | TP | SL: Enable this options to send Buy Entry, Take Profit (TP), and Stop Loss (SL) signals.
Deal Entry and Deal Exit : Copy and paste the message for the deal start signal and close order at Market Price of the DCA Bot. This is the message that will be sent with the alert to the Bot, you must verify that it is the same as the bot so that it can process properly so that it executes and starts the trade.
DCA Bot Multi-Pair: You must activate it if you want to use the signals in a DCA Bot Multi-pair in the text box you must enter (using the correct format) the symbol in which you are creating the alert, you can check the format of each symbol when you create the bot.
👨🏻💻💭 We hope this tool helps enhance your trading. Your feedback is invaluable, so feel free to share any suggestions for improvements or new features you'd like to see implemented.
__
The information and publications within the 3Commas TradingView account are not meant to be and do not constitute financial, investment, trading, or other types of advice or recommendations supplied or endorsed by 3Commas and any of the parties acting on behalf of 3Commas, including its employees, contractors, ambassadors, etc.
[3Commas] Alligator StrategyThe Alligator Strategy
🔷 What it does: This script implements the Alligator Strategy, a trend-following method created by Bill Williams. It uses three customizable moving averages (SMMAs or RMAs) "Jaws," "Teeth," and "Lips" to identify market trends and potential trade opportunities. Additionally, it includes built-in stop-loss and take-profit options for enhanced risk management.
🔷 Who is it for:
Trend Traders: Those who prefer trading in markets with clear directional movement.
Advanced Users: Traders who require customizable tools and dynamic risk management features.
Beginners: Accessible to those new to trading, thanks to its intuitive visual representation of trends and pre-configured settings.
Bot Users: Supports direct signal integration for bot automation, including entries, take-profits, and stop-losses.
🔷 How does it work: The Alligator Jaws, Teeth, and Lips are smoothed moving averages (SMA, EMA, RMA, or WMA) calculated based on the selected source price ( hl2 = (high+low)/2 by default). Their lengths and offsets are customizable:
Jaws: Length 21 , offset 13.
Teeth: Length 13, offset 8.
Lips: Length 8 , offset 5.
When the lines align and spread apart (e.g., Lips > Teeth > Jaws for an uptrend), the strategy identifies a trending market.
Entry Conditions:
Long Trades: Triggered when Close > Lips > Teeth > Jaws.
Short Trades: Triggered when Close < Lips < Teeth < Jaws.
🔷 Why it’s unique:
Customization: Flexible settings for moving average types and lengths to adapt to different market conditions and strategy tester configurations.
Built-in Filters: Trend filters that can reduce false signals in certain scenarios, making it more reliable for trending markets.
Take Profit and Stop Loss:
Configurable as either percentage-based or dynamic.
Stop-loss levels adjust dynamically using the Alligator lines.
Fast exit logic moves the stop-loss closer to the price when trades are in profit.
3Commas Bot Compatibility: Designed for automated trading, allowing traders to configure and execute the strategy seamlessly.
🔷 Considerations Before Using the Indicator
🔸Why the Forward Offset: By shifting the averages forward, the Alligator helps traders focus on established trends while filtering out short-term market noise.
The standard configurations of 13-8, 8-5, and 5-3 were selected based on Bill Williams’ studies of market behavior. However, these values can be adjusted to suit different market conditions:
Volatile Markets: Faster settings (e.g., 10-6, 6-4, 3-2) may provide earlier signals.
Less Volatile Markets: Slower settings (e.g., 21-13, 13-8, 8-5) can help avoid noise and reduce false signals.
🔸Best Timeframes to Use: The Alligator can be applied across all timeframes, but certain timeframes offer better reliability.
Higher Timeframes (H4, D1, W1): Ideal for identifying significant trends and for swing or position trading.
Lower Timeframes: Not recommended due to increased noise but may work for scalping with additional confirmation tools.
🔸Disadvantages of the Alligator Strategy:
Exhausted Entry Levels: High buying levels or low selling levels can lead to momentum exhaustion and potential pullbacks.
False Signals in Ranges: Consolidating markets can produce unreliable signals.
Lagging Indicator: As it is based on moving averages, it may delay reacting to sudden price changes.
🔸Advantages of the Alligator Strategy:
Trend Focused: Simplifies the identification of trending markets.
Noise Reduction: Forward shifts and smoothed averages help filter out short-term price fluctuations.
Broad Applicability: Suitable for forex, crypto, stocks, and commodities.
🔸Important Considerations:
While the Alligator Strategy provides a systematic way to analyze markets, it does not guarantee successful outcomes. Results in trading depend on multiple factors, including market conditions, trader discipline, and risk management. Past performance of the strategy does not ensure future success, and traders should always approach the market with caution.
Risk Management: Define stop-loss levels, position size, and profit targets before entering any trade. Be prepared for the possibility of losses and ensure that your approach aligns with your overall trading plan.
🔷 STRATEGY PROPERTIES
Symbol: BINANCE:BTCUSDT (Spot).
Timeframe: 1D (Daily Timeframe).
Test Period: All historical data available.
Initial Capital: 10000 USDT.
Order Size per Trade: 1% of Capital, you can use a higher value e.g. 5%, be cautious that the Max Drawdown does not exceed 10%, as it would indicate a very risky trading approach.
Commission: Binance commission 0.1%, adjust according to the exchange being used, lower numbers will generate unrealistic results. By using low values e.g. 5%, it allows us to adapt over time and check the functioning of the strategy.
Slippage: 5 ticks, for pairs with low liquidity or very large orders, this number should be increased as the order may not be filled at the desired level.
Margin for Long and Short Positions: 100%.
Indicator Settings: Default Configuration.
Alligator: Source hl2 | Calculation RMA | Jaw 21-13, Teeth 13-8, Lips 8-5.
Strategy: Long & Short.
Max Stop Loss per Trade: 10% of Trade Size.
Exit trades on opposite signal: Enable.
Alligator Stop Loss: Enable.
Alligator Fast Exit: Enable.
🔷 STRATEGY RESULTS
⚠️ Remember, past results do not guarantee future performance.
Net Profit: +355.68 USDT (+3.56%).
Total Closed Trades: 103.
Percent Profitable: 47.57%.
Profit Factor: 1.927.
Max Drawdown: -57.99 USDT (-0.56%).
Average Trade: +3.45 USDT (+3.41%).
Average # Bars in Trades: 16.
🔷 HOW TO USE
🔸Adjust the Alligator Settings:
The default values generally work well: Source hl2 | Calculation RMA | Jaw 21-13, Teeth 13-8, Lips 8-5. However, if you want to use it on timeframes smaller than 4H (4 hours), consider increasing the values to better filter market noise.
Please review the "Indicator Settings" section for configuration.
🔸Choose a Symbol that Typically Trends:
Select an asset that tends to create trends. However, the Strategy Tester results may display poor performance, making it less suitable for sending signals to bots.
🔸Add Trend Filters:
You can enable trend filters like MA and SuperTrend. By default, these are disabled as they are often unnecessary, but you can experiment with their configuration to see if they optimize the strategy's results.
Please review the "Indicator Settings" section for configuration.
🔸Enable Stop Loss Levels:
Activate Stop Loss features, such as Stop Loss % or Alligator Stop Loss. If both are enabled, the one closest to the price during the trade will be applied.
Please review the "Indicator Settings" section for configuration.
🔸Enable Take Profit Levels:
Activate Take Profit options, such as Take Profit % or Alligator Fast Exit. If both are enabled, the one that triggers first will be executed.
Please review the "Indicator Settings" section for configuration.
This is an example with the default settings and how Alligator Stop Loss and Alligator Fast Exit are activated:
In this example, we additionally enable the Take Profit at 10%. We can observe that the Alligator Stop Loss is the active one since it is closer to the price. When the price moves 10% in favor or against the trade, the position is closed. Although the Alligator Fast Exit is enabled, it does not activate because the trades are closed beforehand.
🔸Results Review:
It is important to check the Max Drawdown. This value should ideally not exceed 10% of your capital. Consider adjusting the trade size to ensure this threshold is not surpassed.
Remember to include the correct values for commission and slippage according to the symbol and exchange where you are conducting the tests. Otherwise, the results will not be realistic.
If you are satisfied with the results, you may consider automating your trades. However, it is strongly recommended to use a small amount of capital or a demo account to test proper execution before committing real funds.
🔸Create alerts to trigger the DCA Bot
Verify Messages: Ensure the message matches the one specified by the DCA Bot.
Multi-Pair Configuration: For multi-pair setups, enable the option to add the symbol in the correct format.
Signal Settings: Enable whether you want to receive long or short signals (Entry | TP | SL), copy and paste the the messages for the DCA Bots configured in 3Commas.
Alert Setup:
When creating an alert, set the condition to the indicator and choose "alert() function call only.
Enter any desired Alert Name.
Open the Notifications tab, enable Webhook URL, and paste the Webhook URL from 3Commas.
For more details, refer to the 3Commas section: "How to use TradingView Custom Signals.
Finalize Alerts: Click Create, you're done! Alerts will now be sent automatically in the correct format to 3Commas.
🔷 INDICATOR SETTINGS
🔸Alligator Settings
MA's source: Source price for Alligator moving averages.
MA's Type: Type of calculation for MA's.
Jaw and Offset: Jaw length and offset to the right.
Teeth and Offset: Teethlength and offset to the right.
Lips and Offset: Lips length and offset to the right.
🔸Alligator Style
Plot Alligator: Show Alligator Ribbon.
Plot MA's: Show Alligator MA's.
Colors: Main and Gradient Colors for Bullish Alligator, Berish Alligator, Neutral Alligator. For gradient colors it is recommended to use an opacity of 15.
🔸MA & SuperTrend Filters
MA & Plot: Activate MA Filter and Plot MA on the chart.
Long Entries: When activated, it will only execute entries if the price is above the MA
Short Entries: When activated, it will only execute entries if the price is below the MA.
Source: Source price for moving average calculations.
Length: Candles to be used by the MA calculations.
Type: Type of calculation for MA.
Timeframe: Here you can select a larger timeframe for the filter.
ST & Plot: Activate SuperTrend Filter and Plot SuperTrend on the chart.
Long Entries: When activated, it will only execute entries if the price is above the SuperTrend.
Short Entries: When activated, it will only execute entries if the price is below the SuperTrend.
Source: Source price for SuperTrend calculations.
Length: Candles to be used by the SuperTrend calculations.
Factor: ATR multiplier of the SuperTrend.
Timeframe: Here you can select a larger timeframe for the filter.
🔸Strategy Tester
Strategy: Order Type direction in which trades are executed.
Take Profit %: When activated, the entered value will be used as the Take Profit in percentage from the entry price level.
Stop Loss %: When activated, the entered value will be used as the Stop Loss in percentage from the entry price level. If Alligator Stop Loss is activated, the closest one to the price will be used.
Exit trades on opposite signal: This option closes the trade if the opposite condition is met. For instance, if we are in a long position and a sell signal is triggered, the long position will be closed, and a short position will be opened. The same applies inversely.
Alligator Stop Loss: In a long trade, the lower part of the Alligator indicator will be used as a dynamic stop loss. Similarly, in a short trade, the upper part of the indicator will be used.
Alligator Fast Exit: Its purpose is to attempt to protect movements in favor of the trade's direction. In the case of long trades, once the price and the upper part of the Alligator indicator are above the trade's entry price, the stop loss will be moved to the upper part. For short trades, once the price and the lower part of the Alligator indicator are below the trade's entry price, the stop loss will be moved to the lower part of the Alligator indicator.
Alligator Squeeze Entry: When activated, entries will only be executed if they meet the condition after a neutral zone of the Alligator indicator.
Alligator Squeeze Exit: When this option is activated, any open trades will be closed when the Alligator indicator enters a neutral mode.
Use Custom Test Period: When enabled signals only works in the selected time window. If disabled it will use all historical data available on the chart.
Test Start and End: Once the Custom Test Period is enabled, here you select the start and end date that you want to analyze.
🔸3Commas DCA Bot Signals
Check Messages: Enable the table to review the messages to be sent to the bot.
Entry | TP | SL: Enable this options to send Buy Entry, Take Profit (TP), and Stop Loss (SL) signals to 3Commas.
Deal Entry and Deal Exit : Copy and paste the message for the deal start signal and close order at Market Price of the DCA Bot you created in 3Commas. This is the message that will be sent with the alert to the Bot, you must verify that it is the same as the 3Commas bot so that it can process properly so that it executes and starts the trade.
DCA Bot Multi-Pair: You must activate it if you want to use the signals in a DCA Bot Multi-pair in the text box you must enter (using the 3Commas format) the symbol in which you are creating the alert, you can check the format of each symbol when you create the bot.
🔷 CONCLUSION
The Alligator Strategy is a valuable tool for identifying potential trends and improving decision-making. However, no trading strategy is foolproof. Careful consideration of market conditions, proper risk management, and personal trading goals are essential. Use the Alligator as part of a broader trading system, and remember that consistent learning and discipline are key to success in trading.
👨🏻💻💭 We hope this tool helps enhance your trading. Your feedback is invaluable, so feel free to share any suggestions for improvements or new features you'd like to see implemented.
____________________________________________________________________
The information and publications within the 3Commas TradingView account are not meant to be and do not constitute financial, investment, trading, or other types of advice or recommendations supplied or endorsed by 3Commas and any of the parties acting on behalf of 3Commas, including its employees, contractors, ambassadors, etc.
BTC 5 min SHBHilalimSB A Wedding Gift 🌙
What is HilalimSB🌙?
First of all, as mentioned in the title, HilalimSB is a wedding gift.
HilalimSB - Revealing the Secrets of the Trend
HilalimSB is a powerful indicator designed to help investors analyze market trends and optimize trading strategies. Designed to uncover the secrets at the heart of the trend, HilalimSB stands out with its unique features and impressive algorithm.
Hilalim Algorithm and Fixed ATR Value:
HilalimSB is equipped with a special algorithm called "Hilalim" to detect market trends. This algorithm can delve into the depths of price movements to determine the direction of the trend and provide users with the ability to predict future price movements. Additionally, HilalimSB uses its own fixed Average True Range (ATR) value. ATR is an indicator that measures price movement volatility and is often used to determine the strength of a trend. The fixed ATR value of HilalimSB has been tested over long periods and its reliability has been proven. This allows users to interpret the signals provided by the indicator more reliably.
ATR Calculation Steps
1.True Range Calculation:
+ The True Range (TR) is the greatest of the following three values:
1. Current high minus current low
2. Current high minus previous close (absolute value)
3. Current low minus previous close (absolute value)
2.Average True Range (ATR) Calculation:
-The initial ATR value is calculated as the average of the TR values over a specified period
(typically 14 periods).
-For subsequent periods, the ATR is calculated using the following formula:
ATRt=(ATRt−1×(n−1)+TRt)/n
Where:
+ ATRt is the ATR for the current period,
+ ATRt−1 is the ATR for the previous period,
+ TRt is the True Range for the current period,
+ n is the number of periods.
Pine Script to Calculate ATR with User-Defined Length and Multiplier
Here is the Pine Script code for calculating the ATR with user-defined X length and Y multiplier:
//@version=5
indicator("Custom ATR", overlay=false)
// User-defined inputs
X = input.int(14, minval=1, title="ATR Period (X)")
Y = input.float(1.0, title="ATR Multiplier (Y)")
// True Range calculation
TR1 = high - low
TR2 = math.abs(high - close )
TR3 = math.abs(low - close )
TR = math.max(TR1, math.max(TR2, TR3))
// ATR calculation
ATR = ta.rma(TR, X)
// Apply multiplier
customATR = ATR * Y
// Plot the ATR value
plot(customATR, title="Custom ATR", color=color.blue, linewidth=2)
This code can be added as a new Pine Script indicator in TradingView, allowing users to calculate and display the ATR on the chart according to their specified parameters.
HilalimSB's Distinction from Other ATR Indicators
HilalimSB emerges with its unique Average True Range (ATR) value, presenting itself to users. Equipped with a proprietary ATR algorithm, this indicator is released in a non-editable form for users. After meticulous testing across various instruments with predetermined period and multiplier values, it is made available for use.
ATR is acknowledged as a critical calculation tool in the financial sector. The ATR calculation process of HilalimSB is conducted as a result of various research efforts and concrete data-based computations. Therefore, the HilalimSB indicator is published with its proprietary ATR values, unavailable for modification.
The ATR period and multiplier values provided by HilalimSB constitute the fundamental logic of a trading strategy. This unique feature aids investors in making informed decisions.
Visual Aesthetics and Clear Charts:
HilalimSB provides a user-friendly interface with clear and impressive graphics. Trend changes are highlighted with vibrant colors and are visually easy to understand. You can choose colors based on eye comfort, allowing you to personalize your trading screen for a more enjoyable experience. While offering a flexible approach tailored to users' needs, HilalimSB also promises an aesthetic and professional experience.
Strong Signals and Buy/Sell Indicators:
After completing test operations, HilalimSB produces data at various time intervals. However, we would like to emphasize to users that based on our studies, it provides the best signals in 1-hour chart data. HilalimSB produces strong signals to identify trend reversals. Buy or sell points are clearly indicated, allowing users to develop and implement trading strategies based on these signals.
For example, let's imagine you wanted to open a position on BTC on 2023.11.02. You are aware that you need to calculate which of the buying or selling transactions would be more profitable. You need support from various indicators to open a position. Based on the analysis and calculations it has made from the data it contains, HilalimSB would have detected that the graph is more suitable for a selling position, and by producing a sell signal at the most ideal selling point at 08:00 on 2023.11.02 (UTC+3 Istanbul), it would have informed you of the direction the graph would follow, allowing you to benefit positively from a 2.56% decline.
Technology and Innovation:
HilalimSB aims to enhance the trading experience using the latest technology. With its innovative approach, it enables users to discover market opportunities and support their decisions. Thus, investors can make more informed and successful trades. Real-Time Data Analysis: HilalimSB analyzes market data in real-time and identifies updated trends instantly. This allows users to make more informed trading decisions by staying informed of the latest market developments. Continuous Update and Improvement: HilalimSB is constantly updated and improved. New features are added and existing ones are enhanced based on user feedback and market changes. Thus, HilalimSB always aims to provide the latest technology and the best user experience.
Social Order and Intrinsic Motivation:
Negative trends such as widespread illegal gambling and uncontrolled risk-taking can have adverse financial effects on society. The primary goal of HilalimSB is to counteract these negative trends by guiding and encouraging users with data-driven analysis and calculable investment systems. This allows investors to trade more consciously and safely.
What is BTC 5 min ☆SHB Strategy🌙?
BTC 5 min ☆SHB Strategy is a strategy supported by the HilalimSB algorithm created by the creator of HilalimSB. It automatically opens trades based on the data it receives, maintaining trades with its uniquely defined take profit and stop loss levels, and automatically closes trades when necessary. It stands out in the TradingView world with its unique take profit and stop loss markings. BTC 5 min ☆SHB Strategy is close to users' initiatives and is a strategy suitable for 5-minute trades and scalp operations developed on BTC.
What does the BTC 5 min ☆SHB Strategy target?
The primary goal of BTC 5 min ☆SHB Strategy is to close trades made by traders in short timeframes as profitably as possible and to determine the most effective trading points in low time periods, considering the commission rates of various brokerage firms. BTC 5 min ☆SHB Strategy is one of the rare profitable strategies released in short timeframes, with its useful interface, in addition to existing strategies in the markets. After extensive backtesting over a long period and achieving above-average success, BTC 5 min ☆SHB Strategy was decided to be released. Following the completion of test procedures under market conditions, it was presented to users with the unique visual effects of ☆SB.
BTC 5 min ☆SHB Strategy and Heikin Ashi
BTC 5 min ☆SHB Strategy produces data in Heikin-Ashi chart types, but since Heikin-Ashi chart types have their own calculation method, BTC 5 min ☆SHB Strategy has been published in a way that cannot produce data in this chart type due to BTC 5 min ☆SHB Strategy's ideology of appealing to all types of users, and any confusion that may arise is prevented in this way. Heikin-Ashi chart types, especially in short time intervals, carry significant risks considering the unique calculation methods involved. Thus, the possibility of being misled by the coder and causing financial losses has been completely eliminated. After the necessary conditions determined by the creator of BTC 5 min ☆SHB are met, BTC 5 min ☆SHB Heikin-Ashi will be shared exclusively with invited users only, upon request, to users who request an invitation.
Key Features:
+HilalimSHB Algorithm: This algorithm uses a dynamic ATR-based trend-following mechanism to identify the current market trend. The strategy detects trend reversals and takes positions accordingly.
+Heikin Ashi Compatibility: The strategy is optimized to work only with standard candlestick charts and automatically deactivates when Heikin Ashi charts are in use, preventing false signals.
+Advanced Chart Enhancements: The strategy offers clear graphical markers for buy/sell signals. Candlesticks are automatically colored based on trend direction, making market trends easier to follow.
Strategy Parameters:
+Take Profit (%): Defines the target price level for closing a position and automates profit-taking. The fixed value is set at 2%.
+Stop Loss (%): Specifies the stop-loss level to limit losses. The fixed value is set at 3%.
The shared image is a 5-minute chart of BTCUSDC.P with a fixed take profit value of 2% and a fixed stop loss value of 3%. The trades are opened with a commission rate of 0.063% set for the USDT trading pair on Binance.🌙
FreedX Backtest Plus█ Our new FreedX Backtest PLUS template enhances TradingView backtesting with smart features like Mean Reversion, Flexible Volatility, Liquidation Filter, and Better Trend Filtering, making strategies more effective. It lets users set up automated alerts easily. This guide explains how to make the most of these improved features.
The Trading Date Settings feature in our TradingView script allows you to refine their backtesting parameters by specifying trading dates and hours. This feature enhances the accuracy of the backtest by aligning it with specific time frames and days, ensuring that the strategy is tested under relevant market conditions.
Features:
⚙️ Enable Trading Between Specific Dates:
🎯 Purpose:
→ Allows you to limit the backtesting of their strategy to a specific date range.
💡 How to Use:
→ Input the Start Date and End Date for the backtest period.
→ The script will execute the strategy only within this specified date range.
⚙️ Enable Trading Between Specific Hours:
🎯 Purpose:
→ Allows you to limit the backtesting of their strategy to a specific hour range.
💡 How to Use:
→ Input the start and end hour for in Trading Session section.
→ The script will execute the strategy only within this specified hour range.
⚙️ Enable Trading on Specified Days of the Week:
🎯 Purpose:
→ Gives you the option to conduct backtesting on selected days of the week, tailoring the strategy to particular market behaviours that may occur on these days.
💡 How to Use:
→ Select the days of the week for the backtest.
→ The script will activate the trading strategy only on these chosen days.
█ BUY/SELL TRIGGER SETTINGS
The Buy/Sell Trigger Settings feature is designed to provide users with flexibility in defining the conditions for 'LONG' and 'SHORT' signals based on various indicator types. This customization is crucial for tailoring strategies to different trading styles and market conditions.
Features:
⚙️ Single-Line Plotted Indicators :
🎯 Purpose:
→ Enables you to select a single-line plotted indicator as a source for backtesting. You can define specific levels to trigger 'LONG' or 'SHORT' signals.
💡 How to Use:
→ Choose a Single-Line Plotted indicator as the source.
→ Set the top and bottom levels for the indicator.
→ The script triggers 'LONG' signals at the bottom level and 'SHORT' signals at the top level.
⚙️ Two-Line Plotted Indicators :
🎯 Purpose:
→ Allows backtesting with two-line cross plot sources. Signals are generated based on the crossover of these lines.
💡 How to Use:
→ Select two lines as 'Source 1' and 'Source 2' for the indicator.
→ The script triggers a 'LONG' signal when 'Source 1' crosses above 'Source 2'.
→ Conversely, a 'SHORT' signal is triggered when 'Source 2' crosses above 'Source 1'.
⚙️ Custom Signals :
🎯 Purpose:
→ This setting enables users to define their own criteria for LONG, SHORT, and CLOSE signals based on custom indicator outputs.
💡 How to Use:
→ Select the custom source for your signals.
→ Define the output values that correspond to each signal type (e.g., “1” for 'LONG', “-1” for SHORT, and “0” for CLOSE).
→ The script will trigger signals according to these custom-defined values.
█ TP/SL SETTINGS
The TP/SL (Take Profit/Stop Loss) Settings feature is designed to give users control over their profit securing and risk mitigation strategies. This feature allows for setting custom TP and SL levels, which can be critical in managing trades effectively.
Features:
Custom TP/SL Levels for Long/Short Signals:
🎯 Purpose:
→ Enables users to set specific percentage levels for Take Profit and Stop Loss on long and short signals.
💡 How to Use:
→ In the TP/SL Settings, input the desired percentage for Take Profit (TP) and Stop Loss (SL).
→ For example, to secure a profit at a 10% price increase on LONG signals, set the “Long TP Percentage” to “10”.
█ STRATEGY SETTINGS
Strategy Settings provide a range of options to customize the trading strategy. These settings include leverage, position direction changes, and more, allowing users to tailor their strategy to their risk tolerance and market view.
Features:
⚙️ Enable Reverse Position:
🎯 Purpose:
→ Automatically closes a current position and opens a new one in the opposite direction upon detecting a signal for a market trend change.
🎯 Example:
→ If a LONG signal is received while in a SHORT position, the script will close the SHORT position and open a LONG position.
💡 How to Use:
→ Activate this feature in the Strategy Settings.
⚙️ Enable Spot Mode:
🎯 Purpose:
→ Disables short orders, using short signals only for closing long positions.
💡 How to Use:
→ Select the 'Spot Mode' option in the Strategy Settings.
⚙️ Enable Invert Signals:
🎯 Purpose:
→ Inverts all indicator signals, changing LONG signals to SHORT and vice versa.
💡 How to Use:
→ Opt for the 'Invert Signals' feature in the Strategy Settings.
⚙️ Enable Trailing Stop:
🎯 Purpose:
→ Triggers a trailing stop order on the exchange instead of a standard stop market order.
☢️ Caution:
→ The backtesting of this feature on TradingView may not accurately reflect actual strategy performance due to discrepancies between TradingView and exchange mechanisms.
💡 How to Use:
→ Select 'Trailing Stop' in the Strategy Settings.
⚙️ Enable Realistic TP & SL:
🎯 Purpose:
→ Goal is protect the user from unrealistic stop loss and take profit prices in live exchange trading conditions.
→ That feature continuously checks the take profit, stop loss and move stop loss prices to prevent unrealistic values. It changes their values according to (minimum realistic percent %)
💡 How to Use:
→ Select 'Enable Realistic TP & SL' in the Strategy Settings. Write min allowed percents.
█ LIMITER SETTINGS
Limiter Settings provide a range of options to customize the trading strategy. These settings include drawdown limits,contract limit, tradable ratio, for allowing users to tailor their strategy to their risk tolerance and market view.
⚙️ Leverage :
🎯 Purpose:
→ Allows users to apply leverage to their trades.
☢️ Caution:
→ High leverage can significantly increase the risk of liquidation.
→ High leverage and a high stop-loss price may override your fixed stoploss percentage, adjusting the stop-loss to the liquidation price.
💡 How to Use:
→ Set the desired leverage ratio in the Strategy Settings.
⚙️ Drawdown Limit:
🎯 Purpose:
→ Sets a maximum drawdown limit, automatically halting the strategy if this limit is reached, thereby controlling risk.
💡 How to Use:
→ Input the maximum drawdown limit (default: 100, min: 0, max: 100).
⚙️ Contract Limit:
🎯 Purpose:
→ Sets a maximum contract limit, beyond which the compound effect cannot be used. This is important to prevent market manipulation through large-volume orders.
💡 How to Use:
→ Input the maximum contract limit (min: 0).
⚙️ Tradable Ratio:
🎯 Purpose:
→ Sets a tradable ratio, it uses that ratio calculating entry cost for position. Main purpose is cash-out and cash-in according to balance change.
💡 How to Use:
→ Input the tradable ratio percent (default: 98, min: 0.1, max: 100).
█ CASH-OUT SETTINGS
Cash-Out Settings offer a money-saving mechanism that prevents entering positions with the entire balance due to cashed-out funds. It functions with a webhook alerts, but the 'Override Allocation %' option must be enabled.
⚙️ Cash-out Threshold %:
🎯 Purpose:
→ It is cash-out mechanism, it saves money with a target threshold.
💡 How to Use:
→ Input the threshold (min: 0).
⚙️ Cash-out Per Profitable Trades %:
🎯 Purpose:
→ It is cash-out mechanism, it saves money from every trade with a percent like commission.
💡 How to Use:
→ Input save percent% (min: 0).
█ ADAPTIVE VOLATILITY STRATEGY SETTINGS
Advanced Strategy Settings offer sophisticated methods for managing Stop Loss (SL) and Take Profit (TP) using the Average True Range (ATR). These settings are ideal for traders who want to incorporate volatility into their exit strategies.
Features:
⚙️ Enable ATR Stop Loss:
🎯 Purpose:
→ Automatically sets the Stop Loss price using the Average True Range at the time of entry.
💡 How to Use:
→ Activate 'ATR Stop Loss' to have the SL price calculated based on the current ATR.
⛓ Enable ATR Trailing Stop:
→ Dynamically updates the Stop Loss price with each new bar, according to the Average True Range.
→ Activate 'ATR Trailing Stop'.
→ Set the ATR Period to define the number of bars for ATR calculation.
→ Adjust the ATR SL Multiplier to determine the stop loss distance.
→ Modify the ATR TP Multiplier for setting the take profit distance.
⚙️ Enable ATR Take Profit:
🎯 Purpose:
→ Sets the Take Profit price based on the Average True Range at the time of entry.
💡 How to Use:
→ Choose 'ATR Take Profit' for TP price determination using ATR.
⚙️ Enable ATR Limit Entry:
🎯 Purpose:
→ Trade can not open in candle close price. Price should hit target price that based on average true range value.
💡 How to Use:
→ Choose 'ATR Limit Entry' for entry price determination using ATR.
⛓ Enable ATR Limit Entry Trailing Price:
→ Dynamically updates the entry price with each new bar, according to the Average True Range.
→ Activate 'ATR Limit Entry Trailing Price'.
→ Set the ATR Period to define the number of bars for ATR calculation.
→ Adjust the ATR SL Multiplier to determine the stop loss distance.
→ Modify the ATR TP Multiplier for setting the take profit distance.
█ TREND FILTERING SETTINGS
Trend Filtering Settings are designed to align trading strategies with the prevailing market trend, enhancing the precision of trade entries and exits. These settings utilize moving averages for trend analysis and decision-making.
Features:
⚙️ Enable Moving Average Filtering:
🎯 Purpose:
→ Limits trades based on moving average trends, blocking short trades in an uptrend and vice versa.
💡 How to Use:
→ Enable 'Trend Filtering'.
→ Set Fast and Slow MA Lengths for trend analysis.
→ Select the Timeframe for moving averages.
→ Choose the Moving Average Type for trend filtering.
🎯 Note:
→ Be cautious with timeframe selections; lower timeframes than the base may cause inconsistencies.
⛓ Exit on Trend Reversal:
→ Automatically closes a position when a market trend reversal is detected.
→ Turn on 'Exit on Trend Reversal' in the settings.
⛓ Ignore Counter Signals:
→ Ignores counter signals during trending market way.
→ If the trend way is long. All short signals will ignore and vice versa.
⛓ Enable Drawing On Chart:
→ Visually represents the trend filter directly on the chart for easy reference.
→ Activate 'Drawing On Chart' to see the trend filter overlaid on the trading chart.
⚙️ Enable Adx Filtering:
🎯 Purpose:
→ Limits trades based on adx value, blocking trades if trend strength is not enough or vice versa for invert mode.
💡 How to Use:
→ Enable 'Adx Filtering'.
→ Set Smoothing and Lengths for adx trend analysis.
→ Select level barrier for trend strength.
⚙️ Enable Custom Filtering:
🎯 Purpose:
→ Limits trades based on custom sources, blocking trades according to custom trades.
💡 How to Use:
→ Enable 'Custom Filtering'.
→ Select fast source.
→ Select slow source.
→ Enable lag mode.
█ MEAN REVERSION FILTERING SETTINGS
Mean Reversion Filtering Settings are designed to align trading strategies during accumulation market conditions. They set a distance from a line to permit trading. The purpose is to ensure that when the price strays too far from the mean line, it should revert back. In accumulation markets, price movements are generally horizontal. In such situations, mean reversion will operate like a grid, enabling profitable trades with low drawdown. However, when the market structure begins to trend, mean reversion filters may not be as profitable as in accumulation markets. For instance, let's say the price is rising and we are shorting the market until it reaches the mean price line. As the price goes up and the mean also rises, we will end up closing the position at a higher price, rendering the mean reversion system non-profitable. Therefore, consider this filter wisely; greater distances might work better in trending markets.
Features:
⚙️ Enable Kairi Filter:
🎯 Purpose:
→ Blocks trades based on distance percent between price and moving average.
💡 How to Use:
→ Enable 'Kairi Filter'.
→ Set Length and Distance Percent.
⛓ Enable Trend Drawing On Chart:
→ Visually represents the trend filter directly on the chart for easy reference.
→ Enable 'Drawing On Chart' to see the allowed regions overlaid on the trading chart with arrows.
⚙️ Enable VWAP Filter:
🎯 Purpose:
→ Blocks trades based on distance percent between price and volume weighted average price.
💡 How to Use:
→ Enable 'VWAP Filter'.
→ Set Timeframe as minutes and distance as percent.
⛓ Exit on Crossing with VWAP:
→ Automatically closes a position when the closing price of a candle crosses the VWAP.
→ Choose "Enable", 'Exit on Crossing with VWAP' in the settings.
⛓ Enable Drawing On Chart:
→ Visually represents the trend filter directly on the chart for easy reference.
→ Enable 'Drawing On Chart' to see the allowed regions overlaid on the trading chart with arrows.
█ LIQUIDATION FILTER SETTINGS
Liquidation filter compares the volume data of futures and spot markets.
Large differences in volume indicate unexpected market conditions, such as massive trading activities, which may signal liquidations.
Features:
⚙️ Enable Liquidation Filter:
🎯 Purpose:
→ Blocks trades based on extra ordinary volume differences in spot and futures market.
💡 How to Use:
→ Enable 'Liquidation Filter'.
→ Set behavior to react during that market conditions.
→ Set base amount to filter volume. This amount changes according to timeframe, you should find right amounts.
→ Liquidation candle count means, it is sum of liquidated candle count in last 20 bars.If you set 0, it means feature is disabled.
→ Detection, try to select the spot and perpetual symbols automatically, symbol names varies, it do not support all symbols, you should choose manually in that situation.
█ AUTOMATED ALERT SETTINGS
Automated Alert Settings are designed to integrate your TradingView script with webhook alerts. These settings allow for enhanced strategy execution and management.
Features:
Enable Webhook Alerts:
🎯 Purpose:
→ Trigger BUY, SELL, CHANGE_DIRECTION or MOVE_STOP_LOSS .
💡 How to Use:
→ Enable 'Webhook Alerts' in the settings.
→ Enter your Strategy Key.
→ Optionally, activate 'Override Allocation Percentage' to bypass the preset allocation percentage.
☢️ Caution:
→ Overriding the allocation percentage may result in trade entry errors due to misalignment between entry cost and available balance.
Enable Custom Alerts:
🎯 Purpose:
→ User can produce unique messages for different purposes.
💡 How to Use:
→ Enable 'Custom Alerts' in the settings.
→ Enter your message format type.
█ DEBUGGING SETTINGS
Debugging Settings are crucial for users who want to analyze and optimize their strategies. These settings provide tools for visualizing alerts on charts and accessing detailed data outputs.
Features:
⚙️ Enable Alert Plotting:
🎯 Purpose:
→ Allows users to visualize trading alerts directly on the chart, aiding in strategy analysis and refinement.
💡 How to Use:
→ Activate 'Alert Plotting' to draw alerts on the chart.
☢️ Caution:
→ It is recommended to disable this feature when creating actual trading alerts, as it can cause latency in signal processing.
⚙️ Enable Debugger Mode:
🎯 Purpose:
→ Facilitates strategy debugging by providing detailed data output in the TradingView Data Window.
💡 How to Use:
→ Turn on 'Debugger Mode' to access real-time data and metrics relevant to your strategy.
⚙️ Enable Table:
🎯 Purpose:
→ Facilitates strategy debugging by providing detailed data output in the TradingView Table on chart.
💡 How to Use:
→ Turn on 'Table' to access last closed candle data and metrics relevant to your strategy.
█ ADDITIONAL SETTINGS
⚙️ Enable Bar Magnifier
⚙️ Enable Using standard OHLC
Contrarian DC Strategy - w Entry SL Pause and TrailingStopDonchian Channel Setup:
The strategy uses a tool called the Donchian Channel. Imagine this as two lines (bands) on a chart that show the highest and lowest prices over a certain number of past trading days (default is 20 days).
There's also a centerline, which is the average of these two bands.
Entry Conditions for Trades:
Buying (Going Long): The strategy considers buying when the price touches or falls below the lower band of the Donchian Channel. However, this only happens if there has been a pause after a previous losing trade. This pause is a number of candles where no new trades are taken.
Selling (Going Short): Similarly, the strategy considers selling when price reaches or exceeds the upper band of the Donchian Channel. Again, this is subject to a pause after a losing trade.
Stop Loss and Take Profit:
Each trade has a "Stop Loss" and "Take Profit" set. The Stop Loss is a preset price level where the trade will close to prevent further losses if the market moves against your position. The Take Profit does the same but locks in profit if the market moves in your favor.
The Stop Loss is set based on a percentage of the price at which you entered the trade.
The Take Profit is determined by the Risk/Reward Ratio. This ratio helps balance how much you're willing to risk versus the potential reward.
Trailing Stop Loss:
When a trade is profitable, the strategy should involve a "Trailing Stop Loss." This means the Stop Loss level moves (or trails) the price movement to lock in profits as the market moves in your favor.
For a buy trade, if the price moves above the centerline of the Donchian Channel, the Trailing Stop Loss should be adjusted in the middle between the entry price and the centerline. Viceversa for a sell trade, it should be adjusted in the same way if the price goes below the centerline.
IMPORTANT: There's no allert for the trailing stop at the moment.
Post-Stop Loss Pause:
If a trade hits the Stop Loss (i.e., it's a losing trade), the strategy takes a break before opening another trade in the same direction. This pause helps to avoid entering another trade immediately in a potentially unfavorable market.
In summary, this strategy is designed to make trades based on the Donchian Channel, with specific rules for when to enter and exit trades, and mechanisms to manage risk and protect profits. It's contrarian because it tends to buy when the price is low and sell when the price is high, which is opposite to what many traders might do.
Machine Learning: SuperTrend Strategy TP/SL [YinYangAlgorithms]The SuperTrend is a very useful Indicator to display when trends have shifted based on the Average True Range (ATR). Its underlying ideology is to calculate the ATR using a fixed length and then multiply it by a factor to calculate the SuperTrend +/-. When the close crosses the SuperTrend it changes direction.
This Strategy features the Traditional SuperTrend Calculations with Machine Learning (ML) and Take Profit / Stop Loss applied to it. Using ML on the SuperTrend allows for the ability to sort data from previous SuperTrend calculations. We can filter the data so only previous SuperTrends that follow the same direction and are within the distance bounds of our k-Nearest Neighbour (KNN) will be added and then averaged. This average can either be achieved using a Mean or with an Exponential calculation which puts added weight on the initial source. Take Profits and Stop Losses are then added to the ML SuperTrend so it may capitalize on Momentum changes meanwhile remaining in the Trend during consolidation.
By applying Machine Learning logic and adding a Take Profit and Stop Loss to the Traditional SuperTrend, we may enhance its underlying calculations with potential to withhold the trend better. The main purpose of this Strategy is to minimize losses and false trend changes while maximizing gains. This may be achieved by quick reversals of trends where strategic small losses are taken before a large trend occurs with hopes of potentially occurring large gain. Due to this logic, the Win/Loss ratio of this Strategy may be quite poor as it may take many small marginal losses where there is consolidation. However, it may also take large gains and capitalize on strong momentum movements.
Tutorial:
In this example above, we can get an idea of what the default settings may achieve when there is momentum. It focuses on attempting to hit the Trailing Take Profit which moves in accord with the SuperTrend just with a multiplier added. When momentum occurs it helps push the SuperTrend within it, which on its own may act as a smaller Trailing Take Profit of its own accord.
We’ve highlighted some key points from the last example to better emphasize how it works. As you can see, the White Circle is where profit was taken from the ML SuperTrend simply from it attempting to switch to a Bullish (Buy) Trend. However, that was rejected almost immediately and we went back to our Bearish (Sell) Trend that ended up resulting in our Take Profit being hit (Yellow Circle). This Strategy aims to not only capitalize on the small profits from SuperTrend to SuperTrend but to also capitalize when the Momentum is so strong that the price moves X% away from the SuperTrend and is able to hit the Take Profit location. This Take Profit addition to this Strategy is crucial as momentum may change state shortly after such drastic price movements; and if we were to simply wait for it to come back to the SuperTrend, we may lose out on lots of potential profit.
If you refer to the Yellow Circle in this example, you’ll notice what was talked about in the Summary/Overview above. During periods of consolidation when there is little momentum and price movement and we don’t have any Stop Loss activated, you may see ‘Signal Flashing’. Signal Flashing is when there are Buy and Sell signals that keep switching back and forth. During this time you may be taking small losses. This is a normal part of this Strategy. When a signal has finally been confirmed by Momentum, is when this Strategy shines and may produce the profit you desire.
You may be wondering, what causes these jagged like patterns in the SuperTrend? It's due to the ML logic, and it may be a little confusing, but essentially what is happening is the Fast Moving SuperTrend and the Slow Moving SuperTrend are creating KNN Min and Max distances that are extreme due to (usually) parabolic movement. This causes fewer values to be added to and averaged within the ML and causes less smooth and more exponential drastic movements. This is completely normal, and one of the perks of using k-Nearest Neighbor for ML calculations. If you don’t know, the Min and Max Distance allowed is derived from the most recent(0 index of data array) to KNN Length. So only SuperTrend values that exhibit distances within these Min/Max will be allowed into the average.
Since the KNN ML logic can cause these exponential movements in the SuperTrend, they likewise affect its Take Profit. The Take Profit may benefit from this movement like displayed in the example above which helped it claim profit before then exhibiting upwards movement.
By default our Stop Loss Multiplier is kept quite low at 0.0000025. Keeping it low may help to reduce some Signal Flashing while not taking extra losses more so than not using it at all. However, if we increase it even more to say 0.005 like is shown in the example above. It can really help the trend keep momentum. Please note, although previous results don’t imply future results, at 0.0000025 Stop Loss we are currently exhibiting 69.27% profit while at 0.005 Stop Loss we are exhibiting 33.54% profit. This just goes to show that although there may be less Signal Flashing, it may not result in more profit.
We will conclude our Tutorial here. Hopefully this has given you some insight as to how Machine Learning, combined with Trailing Take Profit and Stop Loss may have positive effects on the SuperTrend when turned into a Strategy.
Settings:
SuperTrend:
ATR Length: ATR Length used to create the Original Supertrend.
Factor: Multiplier used to create the Original Supertrend.
Stop Loss Multiplier: 0 = Don't use Stop Loss. Stop loss can be useful for helping to prevent false signals but also may result in more loss when hit and less profit when switching trends.
Take Profit Multiplier: Take Profits can be useful within the Supertrend Strategy to stop the price reverting all the way to the Stop Loss once it's been profitable.
Machine Learning:
Only Factor Same Trend Direction: Very useful for ensuring that data used in KNN is not manipulated by different SuperTrend Directional data. Please note, it doesn't affect KNN Exponential.
Rationalized Source Type: Should we Rationalize only a specific source, All or None?
Machine Learning Type: Are we using a Simple ML Average, KNN Mean Average, KNN Exponential Average or None?
Machine Learning Smoothing Type: How should we smooth our Fast and Slow ML Datas to be used in our KNN Distance calculation? SMA, EMA or VWMA?
KNN Distance Type: We need to check if distance is within the KNN Min/Max distance, which distance checks are we using.
Machine Learning Length: How far back is our Machine Learning going to keep data for.
k-Nearest Neighbour (KNN) Length: How many k-Nearest Neighbours will we account for?
Fast ML Data Length: What is our Fast ML Length?? This is used with our Slow Length to create our KNN Distance.
Slow ML Data Length: What is our Slow ML Length?? This is used with our Fast Length to create our KNN Distance.
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
TrendFollow-1HThis is a trading strategy specially used on btcusdtperp in binance 1H chart
The most important part of this strategy is to use Support and Resistance with trading volume
Auxiliary indicators are include Directional Movement Index, trading volume, Commodity Channel Index,volume-weighted average price,Range Filter
Why is it not applicable to other trading varieties or exchanges?
Because the activity of each trading target is different from the trading volume, this strategy is very focused on the change of trading volume, so it may not be applicable to every trading variety
The idea of this strategy is to chase when the trend in the market is clear
Determine whether to break support or resistance to identify trends
But the market is full of false breakouts
Therefore, trading volume is an important indicator for judging the true and false.
Therefore, when the price breaks through support or resistance, accompanied by a huge trading volume, and forms a resonance with auxiliary indicators, the strategy will follow the trend, a time stop loss is also set. After entering the market, if there is no immediate profit to the stop profit, you will leave the market first.
But the market is always random, so the profit and loss ratio must be taken into account
Use a fixed stop loss space in exchange for a larger profit space, and ensure that the expected value is positive to make stable profits in the market
Therefore, this strategy uses 3.2% stop loss, 3.3% Take profit1 and 7.2% take profit2
About 1.5:1 profit and loss ratio to ensure positive expected value
Because the market has a clear trend only about 10% of the time
So the trading frequency of this strategy is very low
According to the backtest of up to 2021-01-01 till now , it takes about 5 days to make a transaction
User can choose their own leverage to obtain higher returns. But be sure to prioritize risk.
In order to prevent you from using this strategy without knowing it, the trading date of this strategy is only executed until the release date, and positions will not be opened and closed for subsequent markets.
You can contact me if you want to know more about this strategy
這是專門用於幣安1H圖表中btcusdtperp的交易策略
本策略最重要的部分是將支撐和阻力與交易量一起使用
輔助指標包括ADX,成交量,CCI,VWAP,Range Filter等
為什麼不適用於其他交易品種或交易所?
由於每個交易標的的活躍度與交易量不同,本策略非常注重交易量的變化,因此不一定適用於每個交易品種
這個策略的方法是在趨勢明朗的時候進行趨勢跟隨
確定是否打破支撐或阻力以識別趨勢
但市場充滿假突破
因此,成交量是判斷真假的重要指標。
當價格突破支撐位或阻力位,伴隨著巨大的成交量,並與輔助指標形成共振時,策略會順勢而為,同時設置時間止損。進場後,如果沒有立即獲利到止盈,就離場。
但市場總是隨機的,所以必須考慮盈虧比
用固定的止損空間換取更大的盈利空間,保證預期值為正,才能在市場中穩定獲利
因此,該策略使用 3.2% 止損、3.3% 止盈1 和 7.2% 止盈2
約1.5:1盈虧比,確保正期望值
因為市場只有大約 10% 的時間有明顯的趨勢
所以這個策略的交易頻率很低
根據2021-01-01至今的回測,交易頻率大約5天一次
用戶也可以選擇適合自己的槓桿以獲得更高的收益。但一定要優先考慮風險。
為防止您在不知情的情況下使用本策略,本策略的運行交易的日期僅至2023-05-30止,後續日期將不開倉和平倉。
如果您想了解更多有關此策略的信息,可以聯繫我。
Baseline Cross Qualifier Volatility Strategy with HMA Trend BiasFor trading ES on 30min Chart
Trading Rules
Post Baseline Cross Qualifier (PBCQ): If price crosses the baseline but the trade is invalid due to additional qualifiers, then the strategy doesn't enter a trade on that candle. This setting allows you override this disqualification in the following manner: If price crosses XX bars ago and is now qualified by other qualifiers, then the strategy enters a trade.
Volatility: If price crosses the baseline, we check to see how far it has moved in terms of multiples of volatility denoted in price (ATR x multiple). If price has moved by at least "Qualifier multiplier" and less than "Range Multiplier", then the strategy enters a trade. This range is shown on the chart with yellow area that tracks price above/blow the baseline. Also, see the dots at the top of the chart. If the dots are green, then price passes the volatility test for a long. If the dots are red, then price passes the volatility test for a short.
Take Profit/Stoploss Quantity Removed
1 Take Profit: 100% of the trade is closed when the profit target or stoploss is reached.
2 Take Profits: Quantity is split 50/50 between Take Profit 1 and Take Profit 2
3 Take Profits: Quantify is split 50/25/25.
Stratgey Inputs
Baseline Length
37
Post Baseline Cross Qualifier Enabled
On
Post Baseline Cross Qualifier Bars Ago
9
ATR Length
9
Volatility Multiplier
0
Volatility Range Multiplier
10
Volatility Qualifier Multiplier
2
Take Profit Type
1 Take Profit
HMA Length
11
TUE Argentum Algo V1This algorithm is designed to look trend for opening conditions, apply various filters including volume and volatility, then determine stop outs, break evens, and take profits.
The algorithm uses proprietary math based on the concepts of volatility, standard deviations, average true ranges, and volume to help determine trend. You can filter based on cumulative volume delta, volatility, and moving average based trend. It includes settings for either trend following or contrarian trades, and the ability to go long, short, or both.
The take profit areas are based on proprietary math that help find peaks and valleys. You can adjust the size of the take profits as a percentage of the position, change to static take profits (i.e. take profit in 16 ticks), or use both. You can also disable them and use the natural closing conditions of the trades (detection of trend change in the opposite direction).
Our algo works in any market and will allow user to adjust input settings to be used on any ticker they'd like. It is built as a strategy so you can back test on any ticker to find the exact right settings to dial it in and then switch to live trading mode to see signals. Can be used for day trades or swing trades.
Automated Trading
This algo has been tested and certified to work for automated trading.
Works on Forex
It's confirmed to work on forex so you can trade that market.
Gets you into long successful trades, and gets out of poor ones quickly
It keeps you in the long trades taking small profits along the way, but cuts losers quickly in comparison. This style leads to a high profit factor.
It looks at many variables so you don't have to
- Uses trend analysis for opening/closing conditions.
- It measures the strength of trends to help determine if it should enter or not.
- It uses volume, if the user wants, to help filter entries. The volume calculation is based off of my proprietary cumulative volume delta indicator and helps find if the volume is moving long or short.
- It uses proprietary take profit math to help find peaks and valleys to peel off profits. It is based on the changes in momentum of the underlying.
- It allows for stop outs and break evens based on volatility so they'll always adjust with the movement of the underlying ticker (see the blue lines above and below the opening in the chart).
- It allows for offset break evens to keep a portion of the profit.
Strategy for the Algo
Included so you can understand how to trade with it.
ONE: After loading this strategy onto a ticker turn off volume if it's a ticker with no volume , set the dates at the bottom to when the stock is active (you want to start backtesting when a stock started trading like it trades currently).
TWO: From there adjust the short term trend settings to find the highest win rate and profit factor.
THREE: Then adjust the volume length to find the highest win rate and profit factor. It's important while doing these that you pay attention to a smooth upward equity curve.
FOUR: After this has been done now adjust the long and short risk multipliers. This determines your stop out.
FIVE: Then adjust breakeven multipliers - this is the level at which it changes to a breakeven stop out instead of the previous one. You can also set an offset to keep a small part of the profit.
SIX: Finally adjust the take profit sizes.
SEVEN: Once this is all done go back through the list and adjust up and down by one or two clicks and see if a better curve can be obtained. Very frequently long and short trades have different settings.
EIGHT: When you are finished save the settings in a custom indicator template and put it with it's own chart.
Additional
The settings shown on screen are not the default settings, but are settings chosen for this ticker and timeframe based on the process above. Nearly every ticker and timeframe will require adjustment from default, that's why the algorithm is built to be highly flexible. It can fit any ticker and timeframe, as well as market environment.
This particular setup has the algo running a scalping program on ES 3 min with a 16 tick static target. This algorithm can be set up as a scalper, or used to day trade more regularly. It can also swing trade.
As shown here the algo includes $1.25 of commissions and 1 tick of slippage on all orders (about our average for automated trading on ES).
TUE ADX/MACD Confluence Algorithm V1This algorithm is designed to look at the ADX/MACD confluence for opening conditions, apply various filters including volume and volatility, then determine stop outs, break evens, and take profits.
The ADX and MACD confluence can be a powerful predictor in stock movements. Both of these indicators find trend but do it in different ways. When they're combined they have a high success rate of finding openings. That's done by finding the bar in which both show the same direction - that bar is the beginning of the confluence. I have a free indicator called the TUE ADX/MACD Confluence that you can use to see this in action.
This script will help you find those confluences in an easy to understand manner. It will open a trade on a detected confluence, using the rest of the variables available in the algorithm as filters. You can filter based on cumulative volume delta, volatility, and trend. It includes settings for either trend following or contrarian trades, and the ability to go long, short, or both.
It includes Buy and Sell signals for detected confluences, and will show colored candles to help you determine when to exit a trade if you don't want to follow the included take profit areas. When the candles turn to white that means the detected confluence is no longer in play. The Buy and Sell signals will display on the first occurrence of each confluence.
The take profit areas are based on proprietary math that help find peaks and valleys. You can adjust the size of the take profits as a percentage of the position, change to static take profits (i.e. take profit in 16 ticks), or use both. You can also disable them and use the natural closing conditions (reversal of MACD/ADX confluence).
Our algo works in any market and will allow user to adjust input settings to be used on any ticker they'd like. It is built as a strategy so you can back test on any ticker to find the exact right settings to dial it in and then switch to live trading mode to see signals. Can be used for day trades or swing trades.
Automated Trading
This algo has been tested and certified to work for automated trading.
Works on Forex
It's confirmed to work on forex so you can trade that market.
Gets you into long successful trades, and gets out of poor ones quickly
It keeps you in the long trades taking small profits along the way, but cuts losers quickly in comparison. This style leads to a high profit factor, as you can see over 3.0 in the included ES 3 Min chart.
It looks at many variables so you don't have to
- Uses ADX/MACD confluence for opening/closing conditions.
- It uses volume, if the user wants, to help filter entries. The volume calculation is based off of my proprietary cumulative volume delta indicator and helps find if the volume is moving long or short.
- It uses proprietary take profit math to help find peaks and valleys to peel off profits. It is based on the changes in momentum of the underlying.
- It allows for stop outs and break evens based on volatility so they'll always adjust with the movement of the underlying ticker (see the blue lines above and below the opening in the chart).
- It allows for offset break evens to keep a portion of the profit.
Strategy for the Algo
Included so you can understand how to trade with it.
ONE: After loading this strategy onto a ticker turn off volume if it's a ticker with no volume , set the dates at the bottom to when the stock is active (you want to start backtesting when a stock started trading like it trades currently).
TWO: From there adjust the ADX/MACD to find the highest win rate and profit factor.
THREE: Then adjust the volume length to find the highest win rate and profit factor. It's important while doing these that you pay attention to a smooth upward equity curve.
FOUR: After this has been done now adjust the long and short risk multipliers. This determines your stop out.
FIVE: Then adjust breakeven multipliers - this is the level at which it changes to a breakeven stop out instead of the previous one. You can also set an offset to keep a small part of the profit.
SIX: Finally adjust the take profit sizes.
SEVEN: Once this is all done go back through the list and adjust up and down by one or two clicks and see if a better curve can be obtained. Very frequently long and short trades have different settings.
EIGHT: When you are finished save the settings in a custom indicator template and put it with it's own chart.
Additional
The settings shown on screen are not the default settings, but are settings chosen for this ticker and timeframe based on the process above. Nearly every ticker and timeframe will require adjustment from default, that's why the algorithm is built to be highly flexible. It can fit any ticker and timeframe, as well as market environment.
Also included in the chart above is a $1.25 commission per contract, and a tick of slippage (which on average is about right for automated trading on ES).
[-_-] Level Breakout, Auto Backtesting StrategyDescription:
A Long only strategy based on breakout from a certain level formed by High price. It has auto-backtesting capabilities (you set ranges for the three main parameters: Lookback, TP and SL; the strategy then goes through different combinations of those parameters and displays a table with results that you can sort by Percentage of profitable trades AND/OR Net profit AND/OR Number of trades). So you can, for example, sort only by Net profit to find combination of parameters that gives highest net profit, or sort by Net profit and Percentage profitable to find a combination of parameters that gives the best balance between profitability and profit. The auto-backtesting also takes into account the commission which is set in % in the inputs (make sure to set the same value in properties of the strategy so that auto-backtesting and real backtesting results match).
NOTE: auto-backtesting only find the best combinations and displays them in a table, you will then need to manually set the Lookback, TP and SL inputs for real backtesting to match.
Parameters:
- Lookback -> # of bars for filtering signals; recommended range from 2 to 5
- TP (%) -> take profit; recommended range from 5 to 10
- SL (%) -> stop loss; recommended range from 1 to 5
- Commission (%) -> commission per trade
- Min/Max Lookback -> lookback range for auto-backtesting
- Min/Max TP -> take profit range for auto-backtesting
- Min/Max SL -> stop loss range for auto-backtesting
- Percentage profitable -> sort by percentage of profitable trades
- Net profit -> sort by net profit
- Number of trades -> sort by number of trades
LuxAlgo - Backtester (S&O)The S&O Backtester is an innovative strategy script that encompasses features + optimization methods from our Signals & Overlays™ toolkit and combines them into one easy-to-use script for backtesting the most detailed trading strategies possible.
Our Signals & Overlays™ toolkit is notorious for its signal optimization methods such as the 'Optimal Sensitivity' displayed in its dashboard which provides optimization backtesting of the Sensitivity parameter for the Confirmation & Contrarian Signals.
This strategy script allows even more detailed & precise backtests than anything available previously in the Signals & Overlays™ toolkit; including External Source inputs allowing users to use any indicator including our other paid toolkits for take profit & stop loss customization to develop strategies, along with 10+ pre-built filters directly Signals & Overlays™' features.
🔶 Features
Full Sensitivity optimization within the dashboard to find the Best Win rates or Best Profits.
Counter Trade Mode to reverse signals in undesirable market conditions (may introduce higher drawdowns)
Built-in filters for Confirmation Signals w/ Indicator Overlays from Signals & Overlays™.
Built-in Confirmation exit points are available within the settings & on by default.
External Source Input to filter signals or set custom Take Profits & Stop Losses.
Optimization Matrix dashboard option showing all possible permutations of Sensitivity.
Option to Maximize for Winrate or Best Profit.
🔶 Settings
Sensitivity signal optimizations for the Confirmation Signals algorithm
Buy & Sell conditions filters with Indicator Overlays & External Source
Take Profit exit signals option
External Source for Take Profit & Stop Loss
Sensitivity ranges
Backtest window default at 2,000 bars
External source
Dashboard locations
🔶 Usage
Backtests are not necessarily indicative of future results, although a trader may want to use a strategy script to have a deeper understanding of how their strategy responds to varying market conditions, or to use as a tool for identifying possible flaws in a strategy that could potentially be indicative of good or bad performance in the future.
A strategy script can also be useful in terms of it's ability to generate more complete & configurable alerts, giving users the option to integrate with external processes.
In the chart below we are using default settings and built-in optimization parameters to generate the highest win rate.
Results like the above will vary & finding a strategy with a high win rate does not necessarily mean it will persist into the future, however, some indications of a well-optimized strategy are:
A high number of closed trades (100+) with a consistently green equity curve
An equity curve that outperforms buy & hold
A low % max drawdown compared to the Net Profit %.
Profit factor around 1.5 or above
In the chart below we are using the Trend Catcher feature from Signals & Overlays™ as a filter for standard Confirmation Signals + exits on a higher timeframe.
By filtering bullish signals only when the Trend Catcher is bullish, as well as bearish signals for when the Trend Catcher is bearish, we have a highly profitable strategy created directly from our flagship features.
While the Signals & Overlays features being used as built-in filters can generate interesting backtests, the provided External Sources can allow for even more creativity when creating strategies. This feature allows you to use many indicators from TradingView as filters or to trigger take-profit/stop-loss events, even if they aren't from LuxAlgo.
The chart below shows the HyperWave Oscillator from our Oscillator Matrix™ being used for take-profit exit conditions, exiting a long position on a profit when crossing 80, and exiting a short position when crossing 20.
🔶 Counter Trade Mode
Our thesis has always firmly remained to use Confirmation Signals within Signals & Overlays™ as a supportive tool to find trends & use as extra confirmation within strategies.
We included the counter-trade mode as a logical way to use the Confirmation signals as direct entries for longs & shorts within more contrarian trading strategies. Many traders can relate to using a trend-following indicator and having the market not respect its conditions for entries.
This mode directly benefits a trader who is aware that market conditions are generally not-so-perfect trends all the time. Acknowledging this, allows the user to use this to their advantage by introducing countertrend following conditions as direct entries, which tend to perform very well in ranging markets.
The big downfall of using counter-trade mode is the potential for very large max-drawdowns during trending market conditions. We suggest for making a strategy to consider introducing stop-loss conditions that can efficiently minimize max-drawdowns during the process of backtesting your creations.
Sensitivity Optimization
Within the Signals & Overlays™ toolkit, we allow users to adjust the Confirmation Signals with a Sensitivity parameter.
We believe the Sensitivity paramter is the most realistic way to generate the most actionable Confirmation Signals that can navigate various market conditions, and the Confirmation Signals algorithm was designed specifically with this in mind.
This script takes this parameter and backtests it internally to generate the most profitable value to display on the dashboard located in the top right of the chart, as well as an optimization table if users enable it to visualize it's backtesting.
In the image below, we can see the optimization table showing permutations of settings within the user-selected Sensitivity range.
The suggested best setting is given at the current time for the backtesting window that's customizable within the indicator. Optimized settings for technical indicators are not indicative of future results and the best settings are highly likely / guaranteed to change over time.
Optimizing signal settings has become a popular activity amongst technical analysts, however, the real-time beneficial applications of optimizing settings are limited & best described as complicated (even with forward testing).
🔶 Strategy Properties (Important)
We strongly recommend all users to ensure they adjust the Properties within the script settings to be in line with their accounts & trading platforms of choice to ensure results from strategies built are realistic.
🔶 How to access
You can see the Author's Instructions below to learn how to get access on our website.
Job's Tears - V6This strategy is based on Heikin Ashi + supertrend + DMI + RSI .
Fully functional with placing a new order, taking partial profit at the target price, taking partial profit when hit the take profit, and closing an order.
I wrote this strategy mostly in 5min timeframe.
The commission is default at 0.02% and slippage is 1.
InitCapital is 100 USD, place every new order with 20 USD, close 10 USD when hitting the target price and close 2 USD for every take profits.
No leverage is applied.
I use Heikin Ashi candle patterns to identify the buy/sell signal and supertrend to back my signal. Then I use dmi and rsi to filter out the noises.
My target is to catch a big trend, so I use a lot of take profits to maximize the potential profit.
New Short/New Long: Place a market order for a new position of 20 USD.
Target Price: Place a limited order of 10 USD at that price as soon as a new position is ordered as a basic profit in the pocket.
Take Profit: Place a market order to reduce the position by 2 USD each time.
TaoBao: Place a market order to close all remaining positions. It will only show up after hitting the target price as a way to protect our capital.
Close Short/Long: Place a market order to close all remaining positions.
Customizable Non-Repainting HTF MACD MFI Scalper Bot Strategy v2Customizable Non-Repainting HTF MACD MFI Scalper Bot Strategy v2
This script was originally shared by Wunderbit as a free open source script for the community to work with. This is my second published iteration of this idea.
WHAT THIS SCRIPT DOES:
It is intended for use on an algorithmic bot trading platform but can be used for scalping and manual trading.
This strategy is based on the trend-following momentum indicator . It includes the Money Flow index as an additional point for entry.
This is a new and improved version geared for lower timeframes (15-5 minutes), but can be run on larger ones as well. I am testing it live as my high frequency trader.
HOW IT DOES IT:
It uses a combination of MACD and MFI indicators to create entry signals. Parameters for each indicator have been surfaced for user configurability.
Take profits are now trailing profits, and the stop loss is now fixed. Why? I found that the trailing stop loss with ATR in the previous version yields very good results for back tests but becomes very difficult to deploy live due to transaction fees. As you can see the average trade is a higher profit percentage than the previous version.
HOW IS MY VERSION ORIGINAL:
Now instead of using ATR stop loss, we have a fixed stop loss - counter intuitively to what some may believe this performs better in live trading scenarios since it gives the strategy room to move. I noticed that the ATR trailing stop was stopping out too fast and was eating away balance due to transaction fees.
The take profit on the other hand is now a trailing profit with a customizable deviation. This ensures that you can have a minimum profit you want to take in order to exit.
I have depracated the old ATR trailing stop as it became too confusing to have those as different options. I kept the old version for others that want to experiment with it. The source code still requires some cleanup, but its fully functional.
I added in a way to show RSI values and ATR values with a checkbox so that you can use the new an improved ATR Filter (and grab the right RSI values for the RSI filter). This will help to filter out times of very low volatility where we are unlikely to find a profitable trade. Use the "Show Data" checkbox to see what the values are on the indicator pane, then use those values to gauge what you want to filter out.
Both versions
Delayed Signals : The script has been refactored to use a time frame drop down. The higher time frame can be run on a faster chart (recommended on one minute chart for fastest signal confirmation and relay to algotrading platform.)
Repainting Issues : All indicators have been recoded to use the security function that checks to see if the current calculation is in realtime, if it is, then it uses the previous bar for calculation. If you are still experiencing repainting issues based on intended (or non intended use), please provide a report with screenshot and explanation so I can try to address.
Filtering : I have added to additional filters an ABOVE EMA Filter and a BELOW RSI Filter (both can be turned on and off)
Customizable Long and Close Messages : This allows someone to use the script for algorithmic trading without having to alter code. It also means you can use one indicator for all of your different alterts required for your bots.
HOW TO USE IT:
It is intended to be used in the 5-30 minute time frames, but you might be able to get a good configuration for higher time frames. I welcome feedback from other users on what they have found.
Find a pair with high volatility (example KUCOIN:ETH3LUSDT ) - I have found it works particularly well with 3L and 3S tokens for crypto. although it the limitation is that confrigurations I have found to work typically have low R/R ratio, but very high win rate and profit factor.
Ideally set one minute chart for bots, but you can use other charts for manual trading. The signal will be delayed by one bar but I have found configurations that still test well.
Select a time frame in configuration for your indicator calculations.
Select the strategy config for time frame (resolution). I like to use 5 and 15 minutes for scalping scenarios, but I am interested in hearing back from other community memebers.
Optimize your indicator without filters : customize your settings for MACD and MFI that are profitable with your chart and selected time frame calculation. Try different Take Profits (try about 2-5%) and stop loss (try about 5-8%). See if your back test is profitable and continue to optimize.
Use the Trend, RSI, ATR Filter to further refine your signals for entry. You will get less entries but you can increase your win ratio.
You can use the open and close messages for a platform integration, but I choose to set mine up on the destination platform and let the platform close it. With certain platforms you cannot be sure what your entry point actually was compared to Trading View due to slippage and timing, so I let the platform decide when it is actually profitable.
Limitations: this works rather well for short term, and does some good forward testing but back testing large data sets is a problem when switching from very small time frame to large time frame. For instance, finding a configuration that works on a one minute chart but then changing to a 1 hour chart means you lose some of your intra bar calclulations. There are some new features in pine script which might be able to address, this, but I have not had a chance to work on that issue.
Short Selling EMA Cross (By Coinrule)BINANCE:AVAXUSDT
This short selling script works best in periods of downtrends and general bearish market conditions, with the ultimate goal to sell as the the price decreases further and buy back before a rebound.
This script can work well on coins you are planning to hodl for long-term and works especially well whilst using an automated bot that can execute your trades for you. It allows you to hedge your investment by allocating a % of your coins to trade with, whilst not risking your entire holding. This mitigates unrealised losses from hodling as it provides additional cash from the profits made. You can then choose to to hodl this cash, or use it to reinvest when the market reaches attractive buying levels.
Entry
The exponential moving average ( EMA ) 20 and EMA 50 have been used for the variables determining the entry to the short. EMAs can operate better than simple moving averages due to the additional weighting placed on the most recent data points, whereas simple moving averages weight all the data the same. This means that price is tracked more closely and the most recent volatile moves can be captured and exploited more efficiently using EMAs.
Our backtesting data revealed that the most profitable timeframe was the 30-minute timeframe, this also enabled a good frequency of trades and high profitability.
A fast (shorter term) exponential moving average , in this strategy the EMA 20, crossing under a slow (longer term) moving average, in this example the EMA 50, signals the price of an asset has started to trend to the downside, as the most recent data signals price is declining compared to earlier data. The entry acts on this principle and executes when the EMA 20 crosses under the EMA 50.
Enter Short: EMA 20 crosses under EMA 50.
Exit
This script utilises a take profit and stop loss for the exit. The take profit is set at -8% and the stop loss is set at +16% from the entry price. This would normally be a poor trade due to the risk:reward equalling 0.5. However, when looking at the backtesting data, the high profitability of the strategy (93.33%) leads to increased confidence and showcases the high probability of success according to historical data.
The take profit (-8%) and the stop loss (+16%) of the strategy are widely placed to ensure the move is captured without being stopped out due to relief rallies. The stop loss also plays a role of mitigating losses and minimising risk of being stuck in a short position once there has been a fundamental trend reversal and the market has become bullish .
Exit Short: -8% price decrease from entry price.
OR
Exit Short: +16% price increase from entry price.
Tip: Research what coins have consistent and large token unlocks / highly inflationary tokenomics, and target these during bear markets to short as they will most likely have substantial selling pressure that outweighs demand - leading to declining prices.
The strategy assumes each order is using 30% of the available coins to make the results more realistic and to simulate you only ran this strategy on 30% of your holdings. A trading fee of 0.1% is also taken into account and is aligned to the base fee applied on Binance.
The backtesting data was recorded from December 1st 2021, just as the market was beginning its downtrend. We therefore recommend analysing the market conditions prior to utilising this strategy as it operates best on weak coins during downtrends and bearish conditions.
Webhook Starter Kit [HullBuster]
Introduction
This is an open source strategy which provides a framework for webhook enabled projects. It is designed to work out-of-the-box on any instrument triggering on an intraday bar interval. This is a full featured script with an emphasis on actual trading at a brokerage through the TradingView alert mechanism and without requiring browser plugins.
The source code is written in a self documenting style with clearly defined sections. The sections “communicate” with each other through state variables making it easy for the strategy to evolve and improve. This is an excellent place for Pine Language beginners to start their strategy building journey. The script exhibits many Pine Language features which will certainly ad power to your script building abilities.
This script employs a basic trend follow strategy utilizing a forward pyramiding technique. Trend detection is implemented through the use of two higher time frame series. The market entry setup is a Simple Moving Average crossover. Positions exit by passing through conditional take profit logic. The script creates ten indicators including a Zscore oscillator to measure support and resistance levels. The indicator parameters are exposed through 47 strategy inputs segregated into seven sections. All of the inputs are equipped with detailed tool tips to help you get started.
To improve the transition from simulation to execution, strategy.entry and strategy.exit calls show enhanced message text with embedded keywords that are combined with the TradingView placeholders at alert time. Thereby, enabling a single JSON message to generate multiple execution events. This is genius stuff from the Pine Language development team. Really excellent work!
This document provides a sample alert message that can be applied to this script with relatively little modification. Without altering the code, the strategy inputs can alter the behavior to generate thousands of orders or simply a few dozen. It can be applied to crypto, stocks or forex instruments. A good way to look at this script is as a webhook lab that can aid in the development of your own endpoint processor, impress your co-workers and have hours of fun.
By no means is a webhook required or even necessary to benefit from this script. The setups, exits, trend detection, pyramids and DCA algorithms can be easily replaced with more sophisticated versions. The modular design of the script logic allows you to incrementally learn and advance this script into a functional trading system that you can be proud of.
Design
This is a trend following strategy that enters long above the trend line and short below. There are five trend lines that are visible by default but can be turned off in Section 7. Identified, in frequency order, as follows:
1. - EMA in the chart time frame. Intended to track price pressure. Configured in Section 3.
2. - ALMA in the higher time frame specified in Section 2 Signal Line Period.
3. - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
4. - Linear Regression in the higher time frame specified in Section 2 Signal Line Period.
5. - DEMA in the higher time frame specified in Section 2 Trend Line Period.
The Blue, Green and Orange lines are signal lines are on the same time frame. The time frame selected should be at least five times greater than the chart time frame. The Purple line represents the trend line for which prices above the line suggest a rising market and prices below a falling market. The time frame selected for the trend should be at least five times greater than the signal lines.
Three oscillators are created as follows:
1. Stochastic - In the chart time frame. Used to enter forward pyramids.
2. Stochastic - In the Trend period. Used to detect exit conditions.
3. Zscore - In the Signal period. Used to detect exit conditions.
The Stochastics are configured identically other than the time frame. The period is set in Section 2.
Two Simple Moving Averages provide the trade entry conditions in the form of a crossover. Crossing up is a long entry and down is a short. This is in fact the same setup you get when you select a basic strategy from the Pine editor. The crossovers are configured in Section 3. You can see where the crosses are occurring by enabling Show Entry Regions in Section 7.
The script has the capacity for pyramids and DCA. Forward pyramids are enabled by setting the Pyramid properties tab with a non zero value. In this case add on trades will enter the market on dips above the position open price. This process will continue until the trade exits. Downward pyramids are available in Crypto and Range mode only. In this case add on trades are placed below the entry price in the drawdown space until the stop is hit. To enable downward pyramids set the Pyramid Minimum Span In Section 1 to a non zero value.
This implementation of Dollar Cost Averaging (DCA) triggers off consecutive losses. Each loss in a run increments a sequence number. The position size is increased as a multiple of this sequence. When the position eventually closes at a profit the sequence is reset. DCA is enabled by setting the Maximum DCA Increments In Section 1 to a non zero value.
It should be noted that the pyramid and DCA features are implemented using a rudimentary design and as such do not perform with the precision of my invite only scripts. They are intended as a feature to stress test your webhook endpoint. As is, you will need to buttress the logic for it to be part of an automated trading system. It is for this reason that I did not apply a Martingale algorithm to this pyramid implementation. But, hey, it’s an open source script so there is plenty of room for learning and your own experimentation.
How does it work
The overall behavior of the script is governed by the Trading Mode selection in Section 1. It is the very first input so you should think about what behavior you intend for this strategy at the onset of the configuration. As previously discussed, this script is designed to be a trend follower. The trend being defined as where the purple line is predominately heading. In BiDir mode, SMA crossovers above the purple line will open long positions and crosses below the line will open short. If pyramiding is enabled add on trades will accumulate on dips above the entry price. The value applied to the Minimum Profit input in Section 1 establishes the threshold for a profitable exit. This is not a hard number exit. The conditional exit logic must be satisfied in order to permit the trade to close. This is where the effort put into the indicator calibration is realized. There are four ways the trade can exit at a profit:
1. Natural exit. When the blue line crosses the green line the trade will close. For a long position the blue line must cross under the green line (downward). For a short the blue must cross over the green (upward).
2. Alma / Linear Regression event. The distance the blue line is from the green and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 6 and relies on the period and length set in Section 2. A long position will exit on an upward thrust which exceeds the activation threshold. A short will exit on a downward thrust.
3. Exponential event. The distance the yellow line is from the blue and the relative speed the cross is experiencing determines this event. The activation thresholds are set in Section 3 and relies on the period and length set in the same section.
4. Stochastic event. The purple line stochastic is used to measure overbought and over sold levels with regard to position exits. Signal line positions combined with a reading over 80 signals a long profit exit. Similarly, readings below 20 signal a short profit exit.
Another, optional, way to exit a position is by Bale Out. You can enable this feature in Section 1. This is a handy way to reduce the risk when carrying a large pyramid stack. Instead of waiting for the entire position to recover we exit early (bale out) as soon as the profit value has doubled.
There are lots of ways to implement a bale out but the method I used here provides a succinct example. Feel free to improve on it if you like. To see where the Bale Outs occur, enable Show Bale Outs in Section 7. Red labels are rendered below each exit point on the chart.
There are seven selectable Trading Modes available from the drop down in Section 1:
1. Long - Uses the strategy.risk.allow_entry_in to execute long only trades. You will still see shorts on the chart.
2. Short - Uses the strategy.risk.allow_entry_in to execute short only trades. You will still see long trades on the chart.
3. BiDir - This mode is for margin trading with a stop. If a long position was initiated above the trend line and the price has now fallen below the trend, the position will be reversed after the stop is hit. Forward pyramiding is available in this mode if you set the Pyramiding value in the Properties tab. DCA can also be activated.
4. Flip Flop - This is a bidirectional trading mode that automatically reverses on a trend line crossover. This is distinctively different from BiDir since you will get a reversal even without a stop which is advantageous in non-margin trading.
5. Crypto - This mode is for crypto trading where you are buying the coins outright. In this case you likely want to accumulate coins on a crash. Especially, when all the news outlets are talking about the end of Bitcoin and you see nice deep valleys on the chart. Certainly, under these conditions, the market will be well below the purple line. No margin so you can’t go short. Downward pyramids are enabled for Crypto mode when two conditions are met. First the Pyramiding value in the Properties tab must be non zero. Second the Pyramid Minimum Span in Section 1 must be non zero.
6. Range - This is a counter trend trading mode. Longs are entered below the purple trend line and shorts above. Useful when you want to test your webhook in a market where the trend line is bisecting the signal line series. Remember that this strategy is a trend follower. It’s going to get chopped out in a range bound market. By turning on the Range mode you will at least see profitable trades while stuck in the range. However, when the market eventually picks a direction, this mode will sustain losses. This range trading mode is a rudimentary implementation that will need a lot of improvement if you want to create a reliable switch hitter (trend/range combo).
7. No Trade. Useful when setting up the trend lines and the entry and exit is not important.
Once in the trade, long or short, the script tests the exit condition on every bar. If not a profitable exit then it checks if a pyramid is required. As mentioned earlier, the entry setups are quite primitive. Although they can easily be replaced by more sophisticated algorithms, what I really wanted to show is the diminished role of the position entry in the overall life of the trade. Professional traders spend much more time on the management of the trade beyond the market entry. While your trade entry is important, you can get in almost anywhere and still land a profitable exit.
If DCA is enabled, the size of the position will increase in response to consecutive losses. The number of times the position can increase is limited by the number set in Maximum DCA Increments of Section 1. Once the position breaks the losing streak the trade size will return the default quantity set in the Properties tab. It should be noted that the Initial Capital amount set in the Properties tab does not affect the simulation in the same way as a real account. In reality, running out of money will certainly halt trading. In fact, your account would be frozen long before the last penny was committed to a trade. On the other hand, TradingView will keep running the simulation until the current bar even if your funds have been technically depleted.
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that the endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
Webhook Integration
The TradingView alerts dialog provides a way to connect your script to an external system which could actually execute your trade. This is a fantastic feature that enables you to separate the data feed and technical analysis from the execution and reporting systems. Using this feature it is possible to create a fully automated trading system entirely on the cloud. Of course, there is some work to get it all going in a reliable fashion. Being a strategy type script place holders such as {{strategy.position_size}} can be embedded in the alert message text. There are more than 10 variables which can write internal script values into the message for delivery to the specified endpoint.
Entry and exit use the strategy.entry and strategy.exit calls respectfully. The alert_message parameter has special keywords that my endpoint expects to properly calculate position size and message sequence. The alert message will embed these keywords in the JSON object through the {{strategy.order.alert_message}} placeholder. You should use whatever keywords are expected from the endpoint you intend to webhook in to.
Here is an excerpt of the fields I use in my webhook signal:
"broker_id": "kraken",
"account_id": "XXX XXXX XXXX XXXX",
"symbol_id": "XMRUSD",
"action": "{{strategy.order.action}}",
"strategy": "{{strategy.order.id}}",
"lots": "{{strategy.order.contracts}}",
"price": "{{strategy.order.price}}",
"comment": "{{strategy.order.alert_message}}",
"timestamp": "{{time}}"
Though TradingView does a great job in dispatching your alert this feature does come with a few idiosyncrasies. Namely, a single transaction call in your script may cause multiple transmissions to the endpoint. If you are using placeholders each message describes part of the transaction sequence. A good example is closing a pyramid stack. Although the script makes a single strategy.close() call, the endpoint actually receives a close message for each pyramid trade. The broker, on the other hand, only requires a single close. The incongruity of this situation is exacerbated by the possibility of messages being received out of sequence. Depending on the type of order designated in the message, a close or a reversal. This could have a disastrous effect on your live account. This broker simulator has no idea what is actually going on at your real account. Its just doing the job of running the simulation and sending out the computed results. If your TradingView simulation falls out of alignment with the actual trading account lots of really bad things could happen. Like your script thinks your are currently long but the account is actually short. Reversals from this point forward will always be wrong with no one the wiser. Human intervention will be required to restore congruence. But how does anyone find out this is occurring? In closed systems engineering this is known as entropy. In practice your webhook logic should be robust enough to detect these conditions. Be generous with the placeholder usage and give the webhook code plenty of information to compare states. Both issuer and receiver. Don’t blindly commit incoming signals without verifying system integrity.
Setup
The following steps provide a very brief set of instructions that will get you started on your first configuration. After you’ve gone through the process a couple of times, you won’t need these anymore. It’s really a simple script after all. I have several example configurations that I used to create the performance charts shown. I can share them with you if you like. Of course, if you’ve modified the code then these steps are probably obsolete.
There are 47 inputs divided into seven sections. For the most part, the configuration process is designed to flow from top to bottom. Handy, tool tips are available on every field to help get you through the initial setup.
Step 1. Input the Base Currency and Order Size in the Properties tab. Set the Pyramiding value to zero.
Step 2. Select the Trading Mode you intend to test with from the drop down in Section 1. I usually select No Trade until I’ve setup all of the trend lines, profit and stop levels.
Step 3. Put in your Minimum Profit and Stop Loss in the first section. This is in pips or currency basis points (chart right side scale). Remember that the profit is taken as a conditional exit not a fixed limit. The actual profit taken will almost always be greater than the amount specified. The stop loss, on the other hand, is indeed a hard number which is executed by the TradingView broker simulator when the threshold is breached.
Step 4. Apply the appropriate value to the Tick Scalar field in Section 1. This value is used to remove the pipette from the price. You can enable the Summary Report in Section 7 to see the TradingView minimum tick size of the current chart.
Step 5. Apply the appropriate Price Normalizer value in Section 1. This value is used to normalize the instrument price for differential calculations. Basically, we want to increase the magnitude to significant digits to make the numbers more meaningful in comparisons. Though I have used many normalization techniques, I have always found this method to provide a simple and lightweight solution for less demanding applications. Most of the time the default value will be sufficient. The Tick Scalar and Price Normalizer value work together within a single calculation so changing either will affect all delta result values.
Step 6. Turn on the trend line plots in Section 7. Then configure Section 2. Try to get the plots to show you what’s really happening not what you want to happen. The most important is the purple trend line. Select an interval and length that seem to identify where prices tend to go during non-consolidation periods. Remember that a natural exit is when the blue crosses the green line.
Step 7. Enable Show Event Regions in Section 7. Then adjust Section 6. Blue background fills are spikes and red fills are plunging prices. These measurements should be hard to come by so you should see relatively few fills on the chart if you’ve set this up as intended. Section 6 includes the Zscore oscillator the state of which combines with the signal lines to detect statistically significant price movement. The Zscore is a zero based calculation with positive and negative magnitude readings. You want to input a reasonably large number slightly below the maximum amplitude seen on the chart. Both rise and fall inputs are entered as a positive real number. You can easily use my code to create a separate indicator if you want to see it in action. The default value is sufficient for most configurations.
Step 8. Turn off Show Event Regions and enable Show Entry Regions in Section 7. Then adjust Section 3. This section contains two parts. The entry setup crossovers and EMA events. Adjust the crossovers first. That is the Fast Cross Length and Slow Cross Length. The frequency of your trades will be shown as blue and red fills. There should be a lot. Then turn off Show Event Regions and enable Display EMA Peaks. Adjust all the fields that have the word EMA. This is actually the yellow line on the chart. The blue and red fills should show much less than the crossovers but more than event fills shown in Step 7.
Step 9. Change the Trading Mode to BiDir if you selected No Trades previously. Look on the chart and see where the trades are occurring. Make adjustments to the Minimum Profit and Stop Offset in Section 1 if necessary. Wider profits and stops reduce the trade frequency.
Step 10. Go to Section 4 and 5 and make fine tuning adjustments to the long and short side.
Example Settings
To reproduce the performance shown on the chart please use the following configuration: (Bitcoin on the Kraken exchange)
1. Select XBTUSD Kraken as the chart symbol.
2. On the properties tab set the Order Size to: 0.01 Bitcoin
3. On the properties tab set the Pyramiding to: 12
4. In Section 1: Select “Crypto” for the Trading Model
5. In Section 1: Input 2000 for the Minimum Profit
6. In Section 1: Input 0 for the Stop Offset (No Stop)
7. In Section 1: Input 10 for the Tick Scalar
8. In Section 1: Input 1000 for the Price Normalizer
9. In Section 1: Input 2000 for the Pyramid Minimum Span
10. In Section 1: Check mark the Position Bale Out
11. In Section 2: Input 60 for the Signal Line Period
12. In Section 2: Input 1440 for the Trend Line Period
13. In Section 2: Input 5 for the Fast Alma Length
14. In Section 2: Input 22 for the Fast LinReg Length
15. In Section 2: Input 100 for the Slow LinReg Length
16. In Section 2: Input 90 for the Trend Line Length
17. In Section 2: Input 14 Stochastic Length
18. In Section 3: Input 9 Fast Cross Length
19. In Section 3: Input 24 Slow Cross Length
20. In Section 3: Input 8 Fast EMA Length
21. In Section 3: Input 10 Fast EMA Rise NetChg
22. In Section 3: Input 1 Fast EMA Rise ROC
23. In Section 3: Input 10 Fast EMA Fall NetChg
24. In Section 3: Input 1 Fast EMA Fall ROC
25. In Section 4: Check mark the Long Natural Exit
26. In Section 4: Check mark the Long Signal Exit
27. In Section 4: Check mark the Long Price Event Exit
28. In Section 4: Check mark the Long Stochastic Exit
29. In Section 5: Check mark the Short Natural Exit
30. In Section 5: Check mark the Short Signal Exit
31. In Section 5: Check mark the Short Price Event Exit
32. In Section 5: Check mark the Short Stochastic Exit
33. In Section 6: Input 120 Rise Event NetChg
34. In Section 6: Input 1 Rise Event ROC
35. In Section 6: Input 5 Min Above Zero ZScore
36. In Section 6: Input 120 Fall Event NetChg
37. In Section 6: Input 1 Fall Event ROC
38. In Section 6: Input 5 Min Below Zero ZScore
In this configuration we are trading in long only mode and have enabled downward pyramiding. The purple trend line is based on the day (1440) period. The length is set at 90 days so it’s going to take a while for the trend line to alter course should this symbol decide to node dive for a prolonged amount of time. Your trades will still go long under those circumstances. Since downward accumulation is enabled, your position size will grow on the way down.
The performance example is Bitcoin so we assume the trader is buying coins outright. That being the case we don’t need a stop since we will never receive a margin call. New buy signals will be generated when the price exceeds the magnitude and speed defined by the Event Net Change and Rate of Change.
Feel free to PM me with any questions related to this script. Thank you and happy trading!
CFTC RULE 4.41
These results are based on simulated or hypothetical performance results that have certain inherent limitations. Unlike the results shown in an actual performance record, these results do not represent actual trading. Also, because these trades have not actually been executed, these results may have under-or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated or hypothetical trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to these being shown.
BlueFX Strategy We are re publishing the script so the Script Title doesn't display the old version number, to stop further confusion with our members.
This title will now remain constant, until you click into the strategy and the latest version number will be shown.
The previous release notes below are copied from the previous descriptions with the release note updates shown.
Hi Traders,
I hope everyone is great - its a long one - but worth the read, I promise....
Firstly, thank you to our members for being patient with this release - it took longer than anticipated but now with even more functionality too - and some improved profitability in back-testing on our H1 time frame especially - explained further below.
Secondly, thank you to the individuals that have made this happen - you know who you are! Sounds like an Oscar speech right.... sorry.
This tool we believe really does change the game - please read on to find out more.
As a brief reminder this builds upon on initial V1 and V2 indicator/scripts ...
The strategy itself
Our strategy will help you identify the current trend in the markets and highlight when this is changing. The strategy itself is based upon 4 indicators lining up in total confluence to increase the probability of the trade being a success.
Absolutely no technical analysis is needed to trade this successfully - this can be used on all time frames and all pairs - obviously with varying profitability as all pairs work differently - this can be reviewed quickly in 'Strategy Tester' to hone in on your own desired settings.
When all criteria is in alignment the strategy will convert all candles to the relevant colour - Green for an uptrend and Red for a downtrend; a candle that is printed normally simply shows that no current trend is in place to warrant a colour change. A normal coloured candle could possibly indicate a change in current market direction or the market consolidating before a further move in the initial direction.
When a new signal is valid, 'Blue FX Buy'' or 'Blue FX Sell' will be displayed and the small arrow shown on candle open for entry. (*Now along with Entry Price (EP), Stop Loss (SL), Take Profit (TP) and Lot size that is based on the risk parameters you have set personally on V3)
Version 2 was created with H4 confluence built in and also a display of a suggested Stop Loss (SL) and multiple Take Profits (TP's) on the H1 (One Hour) time frame - thus making your entry even easier and your SL more reliable - these suggested SL's and targets were based on the ATR of that pair at that time - a popular choice amongst traders - automatically built in.
What is a Trading View Script?
A script is like an indicator but better, we can prove the success of our strategy by using Trading Views strategy tester function. As shown below and on the chart - you can see the 'Buy' and 'Close Buy' on the chart, supported by a live trading log showing you the entry, entry price date, volume and closing price.
This is a great function for numerous reasons; firstly, you know you are using a profitable strategy, secondly you can use this as a trading journal to support your trading too. This in itself can help you with your trading psychology - letting winning trades run is a prime example of this. Take confidence in the statistics and performance over time.
Ultimately, we believe we have saved YOU the need to firstly, find an edge and a strategy - and all of the time it takes to BACKTEST a strategy - to then find it may or may not work - and then you start again!
Well guess what?
We know this works and it takes you seconds to see it.
Everyone can see the statistics themselves for 2020 to date (and previous!); an account gain of over 500% if you managed to catch all trades risking 1% per trade. I understand that catching all trades is difficult but even if you caught a third, that's still not too bad right?
Disclaimer alert; Please remember past performance is exactly that - how our strategy performed over those dates tested, it is not obviously a guarantee of future performance.
Even better, you/we can still hone in these settings to find an improved performance per pair on any given time frame and money management plan. (We are currently looking into automating this process too)
Default settings are set for use with the H1 time frame - no extra confluence checking is needed with these settings.
So what are the specific changes I hear you ask?
- Visibility of the SL and TP labels across all time frames.
- Visibility of all previous SL and TP labels with the click of a button (Prev. was only 2).
- Proof of the profitability of the strategy - we had this in V1 but this was based on trend following with the exit - we didn't in V2 when we added the SL and TP display function.
- The ability to customise the parameters and see the instant impact of the desired pair/time-frame and testing date range - of course some work better than others and will do at different times - once we have found a way to test this in an automated way we could look to do this monthly/quarterly to ensure we are using 'optimal' parameters at all times.
- Another game changer here is the addition of a lot size calculator - set your balance, set your risk and the LOT SIZE you should be trading will appear as if by magic - no need to use any other tool to do this. For inexperienced traders and especially trading stocks/ gold / commodities we suggest you check the contract sizes first as some brokers may operate differently. This visual cue will help ensure you are managing your risk and save you time in checking the right Lot Size for your trade (every pair has a different pip value and every trade a different SL).
- Although not required in our H1 settings currently - we have added more higher time frame confluences - which can improve the profitability of different pairs on different time frames in testing.
- As our tool can be used across all instruments we have a pull down menu for Crypto/Metals/Stocks/ Commodities , etc.
- The option to also test fixed lot size or percentage - see the benefit of compounding right away.
- The option to turn the testing function on and off.
Let's see an example......
An example trade - display Entry, SL, multiple TP, lot size and contract size.
snapshot
We have deliberately set the TP3 to be an increased target, this way we can capitalise on a large move in the market, should the move reverse and the opposite signal appears we close the trade anyway and follow the new signal.
I am unable to add other pictures in this Script description - but we will include in our Public channel and update our website to show them over the coming days.
I hope you can all see the functionality in this tool, the profitability in historic tests and how it can be used to give you your edge.
How do you access this I hear you ask?
Please visit our website for signup / purchase information in the first instance (the link is on our trading view profile / signature) or send us a private message on here - its impossible to keep track of comments on our posts so to ensure we don't miss you, a private DM will be great please.
Thank you for reading, we hope you choose to join our vastly growing community.
Kind regards
Darren
Blue FX
Jun 14
Release Notes: Default settings have been improved, providing a 600% gain YTD in back testing with less trades too.
Jul 4
Release Notes: Trend filter using ADX - our strategy is based on a trending market, adding the ADX filter to our strategy allows us to remove trades under the threshold level set. Previously - we tried to teach our members how to spot the ranging markets to help further increase their successes (although the stats were not based on any manual intervention) - now they don't have too.
Specific parameters set into the code - detects the pair and TF to shown them automatically - our method has been solid YOY growth based on a fixed 0.01 lot size to gain consistent yearly consistent results.
Trade volumes substantially reduced with a much higher win rate - due to the specific parameters and ADX filter.
No pull down menu when flicking between instruments - all done automatically; making it easier for trades flicking between trading instruments.
More TP options for testing - we have TP1/2/3 and other variables including FT (Follow Trend) / FT + SL (Follow trend with Stop loss) / TS (Trail Stop function)
Smaller labels showing entry, SL and TP, etc - much clearer on screen and on your app.
Lot sizes fixed - we had a previous bug affecting some currencies - as always where money is involved and managing risk, ensure you check and are comfortable this is correct of course
Filter for days of the week - some pairs hate specific days, a great tool, see how removing Fridays affects the performance in seconds.
Back testing on all instruments - not previously available - trade stocks like Tesla or Lloyds - or indices? We can give you back testing data for them all.
Filter for trading sessions - like the days of the week - if you are only trading London and US sessions, back testing data for other sessions is pretty pointless - now you can remove them too!
If you wish to just stay with the default V3 settings its simple, turn 'Use pre-defined parameter?' Off - and turn off ADX - your chart will then look like the initial v3.0 strategy anyway. However, every pair has improved performance we have found when including ADX - each pair is affected differently with a higher or lower ADX Threshold - this is parameter #9.
I don't think there is much more that can be added now - fuelled by our ambition - to provide our members with an easy yet profitable trading strategy for both beginner or experienced trader. We have this at the forefront of our minds when adding and reviewing functions.
Follow the trades, stay disciplined and don't focus on the money. Focus on the 'process' of following the strategy, its much easier on your mind too. Far easier following instructions than trying to do something without - follow your plan, the process and the money will follow.
If you wish to see all of the back testing data for each pair - hop into our Discord Server and check out the #public-backtesting-channel - all of them will be there when I post them tonight.
Jul 5
Release Notes: Another quick update.
More days of week added - Sat and Sunday trading sessions - (Sat - just crypto is open on TV)
Also a specific setting for trading just a certain time of day - this is based on EST time you will will need to convert back to your time zone for this to work.
For example, if you would like to test trading EURUSD between 7am and 11am - you will need to find the EST time for this which is 2am to 6am, you will then see these trades in the list of trades section. This is ideal for scalping certain sessions where all trades will be open and closed promptly.
I use the 'Time Buddy' app for this as its quite straight forward.
Regards
Darren
18 hours ago
Release Notes: Update - correcting the entry price label error.
Grover Llorens Activator Strategy AnalysisThe Grover Llorens Activator is a trailing stop indicator deeply inspired by the parabolic SAR indicator, and aim to provide early exit points and reversal detection. The indicator was posted not so long ago, you can find it here :
Today a strategy using the indicator is proposed, and its profitability is analyzed on 3 different markets with the main time frame being 1 hour, remember that lower time frames involve lower absolute price changes, therefore we are way more affected by the spread, and we can require a larger position sizing depending on our investment target, trading higher time-frames is always a good practice and this is why 1 hour is selected. Based on the result we might make various conclusions regarding the indicator accuracy and might have ideas on future improvements of the indicator.
I'am not great when it comes to strategy design, i still hope to share correct and useful information in this post, let me know your thoughts on the post format and if i should make more of these.
Setup And Rules
The analysis is solely based on the indicator signals, money management isn't taken into account, this allow us to have an idea on the indicator robustness and resilience, particularly on extremely volatile markets and ones exhibiting a chaotic structure, altho it is normally good practice to close any position before a market closure in order to avoid any potential major gaps.
The settings used are 480 for length and 14 for mult, this create relatively mid term signals that are suited for a trend indicator such as the Grover Llorens Activator, unfortunately we can't infer the indicator optimal settings, thats how it is with any technical indicator anyway.
Here are the rules of our strategy :
long : closing price cross over the indicator
short : closing price cross under the indicator
We use constant position sizing, once a signal is triggered all the previous positions are closed.
Description Of The Statistics Used
Various statistics are presented in this post, here is a brief description of the main ones :
Percent Profitability (higher = better): Percentage of winning trades, that is : winning trades/total number of trades × 100
Maximum Drawdown (lower = better) : The highest difference between a peak and a valley in the balance, that is : peak - valley , in percentage : (peak - valley)/peak × 100
Profit Factor (higher = better) : Gross profit divided by gross loss, values under 1 represent gross losses superior to the gross profits
Remember that more volatility = more risk, since higher absolute price changes can logically cause larger losses.
EURUSD
The first market analyzed is the Forex market with the EURUSD major pair with a position sizing of 1000 units (1 micro lot). Since October EURUSD is not showing any particular strong trend but posses a discrete rising motion, fortunately cycles can be observed.
The equity was rising until two trades appeared causing a decline in the equity. Before October a bearish market could be observed.
We can see that the equity is rising, the trend still posses various retracements that affect our indicator, however we can see that the indicator totally nail the end of the trend, thats the power of converging toward the price.
In short :
$ 86.63 net profit
340 closed trades
37.65 % profitable (thats a lot of loosing trades)
1.19 profit factor
$ 76.67 max drawdown
Applying a spread would create negative results (in general the average spread is used), not a great start...
BTCUSD
The cryptocurrency market is relatively more volatile than others, which also mean potentially higher returns, we test the indicator using certainly the most traded cryptocurrency, BTCUSD. We will use a position sizing of 1 unit.
In the case of BTCUSD the strategy balance is relatively stationary around the initial capital, with of course high dispersion.
from september to december the market is bearish with various ranging periods, no apparent cycles can be observed, except maybe in the ranging period of october, this ranging period is followed by a non linear trend (relatively parabolic) that the indicator failed to capture in its integrity (this is a recurrent problem and it is starting to piss me off xD).
In short :
$ 2010.64 net profit (aka how i bet the crypto market)
395 closed trades
38.23 % profitable
1.036 profit factor
$ 5738.01 max drawdown (aka how i lost to the crypto market)
AMD
AMD stand for Advanced Micro Devices and is a company focused on the development of computer technology, i love the microprocessor market and i really like AMD who start this year in a pretty great way with a net bullish trend.
The performance of the indicator on AMD is decent (at last !) with the equity producing many new higher highs. The indicator performance still drop in the middle end of 2019 with a large equity drawdown of 17$ caused by the gap of august 8. Unfortunately AMD, like lot of well behaving stocks can only tells us that the indicator has good performances on heavily trending markets with no excess of noise or chaotic structures.
In short :
$ 17.86 net profit (Enough for a consistent lunch)
295 closed trades
36.27 % profitable
1.414 profit factor
$ 10.37 max drawdown.
Conclusion
A strategy using the recently proposed Grover Llorens activator has been presented. We can easily conclude that the indicator can't possibly generate long term returns under chaotic and volatile markets, and could even produce unnecessary trades in trending markets without much parasitic fluctuations such as noise and retracements (think about a simple linear trend) since the indicator converge toward the price and would therefore automatically cross over/under the trend, thus guaranteeing a false signal.
However we have seen its ability to provide accurate early reversal detection shine from time to time, thus over performing lagging indicators in this aspect, however the duration of price fluctuations isn't fixed at a certain period, the rate of convergence should be way faster during volatile fluctuations, of moderate speed during more cyclic fluctuations, and really slow with apparent long term trends, this could be achieved by making the indicator adaptive, but it won't really make it necessarily perform better.
That said i still believe that converging trend indicators are really interesting and aim to capture the non lasting behavior of price fluctuations, they shouldn't receive so much hate (think about the poor p-sar).
Thanks for reading !
Cyatophilum Bands Pro Trader V3 [BACKTEST]An Original Automated Strategy that can be used for Manual or Bot Trading, on any timeframe and market.
>> Presentation <<
How it works
No, these are NOT Bollinger Bands..
The Cyatophilum Bands are an original formula that I created. You will probably never find it anywhere else.
Their behavior is the following:
When they are horizontal it means the trend is going sideways and they represent supports (lower band) and resistances (upper band).
When they are climbing or falling it means the trend is either bullish or bearish and they represent Trend Lines.
The strategy enters Long on a Bull Breakout and enters Short on a Bear Breakout.
The exits are triggered either on a Trend Reversal, a Stop Loss or a Take Profit.
FEATURES
Take Profit System
Stop Loss System
Show Net profit Line
More features here
Finding a profitable configuration is GUARANTEED
0. Choose your symbol and timeframe. Then add the Backtest version to your chart. If at any time you decide to change your timeframe, go back to step 1.
1. Open the strategy tester and look at the buy & hold line.
If it is mostly climbing (last value greater than 0) then it means we are in a bull market. You should then opt or a long only strategy.
If it is mostly dropping (last value lower than 0) then it means we are in a bear market. You should then opt or a short only strategy.
Note : This first step is really important. Trading against the market has very little chances to succeed.
2. Go into the Strategy Input Parameters:
check "Enable Long Results" and uncheck "Enable Short Results" if you are in a long only strategy.
check "Enable Short Results" and uncheck "Enable Long Results" if you are in a short only strategy.
3. Open the Strategy Tester and open the Strategy Properties.
We are going to find the base parameters for the Bands.
The "Bands Lookback" is the main parameter to configure for any strategy. It corresponds to how strong of a support and resistance the bands will behave. The lower the timeframe, the higher lookback you will need. It can move from 10 to 60. For example 60 is a good value for a 3 minute timeframe. Try different values, and look at the "net profit" value in the Overview tab of the Strategy Tester. Keep the Lookback value that shows the best net profit value.
Then play with the "Bands Smoothing" from 2 to 20 and keep the best net profit value.
The "Band Smoothing" is used to reduce noise.
Usually, the default value (10) is what gives the best results.
From this point you should already be able to have a profitable strategy (net profit>0), but we can improve it using the Stop Loss and the Take Profit feature.
4. To activate the Stop Loss feature, click on the "SECURITY" checkbox
You should see horizontal red lines appear.
A Long/short exit alert will be triggered if the price were to cross this line. (A red Xcross will appear)
Choose the Stop Loss percentage.
On top of that, you can enable the feature "Trailing Stop". It will make the red line follow the price, at a speed that you can configure with the "Trailing Speed" parameter.
Now, sometimes a stop is triggered and it was just a fakeout. You can enable "Re-entries after a stop" to avoid missing additional opportunities.
5. To activate the Take Profit feature, click on the "TAKE PROFIT" checkbox
You should see horizontal green lines appear.
A Long/short exit alert will be triggered if the price were to cross this line. (A flag will appear)
Choose the Take Profit percentage.
A low takeprofit will provide a safer strategy but can reduce potential profits.
A higher takeprofit will increase risk but can provide higher potential profits.
6. Money Management
You can configure the backtest according to your own money management.
Let's say you have 10 000 $ as initial capital and want to trade only 5%, set the Order Size to 5% of Equity.
You can increase net profit by increasing the order size but this is at your own risk.
How to create alerts explained here
Sample Uses Cases
Use it literally anywhere
This indicator can be used on any timeframe and market (not only cryptocurrencies).
About the Backtest below
The Net Profit (Gross profit - Gross loss) is calculated with a commission of 0.05% on each order.
No leverage used. This is a long strategy.
Each trade is made with 10 % of equity from an inital capital of 10 000$. The net profit can be bigger by increasing the % of equity but this a trader's rule to minimise the risk.
I am selling access to all my indicators on my website : blockchainfiesta.com
To get a 2 days free trial, just leave a comment , thanks !
Join my Discord for help, configurations, requests, etc. discord.gg
cryptomars 1.0 signal Concussion trend
Description:
1. In the indicator, there is an orange signal that fluctuates linearly. It is a buy signal when it goes from bottom to top. When the signal line remains in the upper position, it indicates a multi-party trend.
2. When it goes from top to bottom, it indicates a sell signal. When the signal line remains below, it indicates a sales trend.
3. Depending on the time level, when the position of the signal line changes, determine whether the current candle is completed or not according to the time level of the chart you selected to determine the signal. For example, if you select a chart level of 5 meters, then when the signal line changes, for example, it will send a sell signal from top to bottom. At this time, please do not rush to sell. You should wait for this 5 meter candlestick to complete. When the candle is over and the next candle is started, if the signal line remains in the top-down form, the sell signal is normal and you can sell it.
Because the position of the signal appears, it is the location of the sale. During the completion of the candlestick , the signal may disappear after disappearing. We only have to wait for a while to get a more stable deal.
4. The alarm setting is very simple. There are two lines in the indicator. One is the orange signal line that fluctuates up and down, and the other is the fixed zero line of “zero”.
We set it in the alarm. When the signal line passes "zero" from the top, the short signal is sent only when the candle map is completed. When the signal line passes "zero" from "up" below, the signal is sent for a long time when the candlestick is completed.
One trick, the appearance of the signal, is that the price runs in one direction for a while, so it appears at or near the bottom. Because, when we have already made a profit in the transaction, we can make a profit in advance, and we do not need to wait for the opposite signal to stop the profit and reduce the risk of profit retracement.
Because in this market, the fluctuations are very large, and the people who compete are also very fierce. What we need to do is to make every transaction as possible, and we are all profitable. If we sell and find that the price is still rising, please don't feel sorry, don't consider eating all the profits.
6. When the signal appears, in most cases, even in the impact trend, it will still run a distance in the direction of the signal, that is, you will profit, so please close the position and make a profit in time. Otherwise, when the price volatility is too small, you miss the profit point, the price starts to run in the opposite direction, and you may change from profit to loss.
BITMEX's trailing stop loss is a great feature, please use it flexibly.
7, if it is a shock trend, please try not to trade.
8. We recommend that you turn on the “cryptomars 3.0” and “cryptomars 2.0” indicators. No matter who signs the trade first, you can trade, which can help you get more profit.
9. Remember, I hope this indicator will be your powerful assistant, but please don't rely on it completely. Learning more trading knowledge and skills is even more important. Therefore, when we consider the profitable position, you can use your trading skills, MACD , KDJ, etc. to assist and profit in a more suitable position.
cryptomars signal short 2.0Description:
1. In the indicator, there is an orange signal that fluctuates linearly. It is a buy signal when it goes from bottom to top. When the signal line remains in the upper position, it indicates a multi-party trend.
2. When it goes from top to bottom, it indicates a sell signal. When the signal line remains below, it indicates a sales trend.
3. Depending on the time level, when the position of the signal line changes, determine whether the current candle is completed or not according to the time level of the chart you selected to determine the signal. For example, if you select a chart level of 5 meters, then when the signal line changes, for example, it will send a sell signal from top to bottom. At this time, please do not rush to sell. You should wait for this 5 meter candlestick to complete. When the candle is over and the next candle is started, if the signal line remains in the top-down form, the sell signal is normal and you can sell it.
Because the position of the signal appears, it is the location of the sale. During the completion of the candlestick , the signal may disappear after disappearing. We only have to wait for a while to get a more stable deal.
4. The alarm setting is very simple. There are two lines in the indicator. One is the orange signal line that fluctuates up and down, and the other is the fixed zero line of “zero”.
We set it in the alarm. When the signal line passes "zero" from the top, the short signal is sent only when the candle map is completed. When the signal line passes "zero" from "up" below, the signal is sent for a long time when the candlestick is completed.
One trick, the appearance of the signal, is that the price runs in one direction for a while, so it appears at or near the bottom. Because, when we have already made a profit in the transaction, we can make a profit in advance, and we do not need to wait for the opposite signal to stop the profit and reduce the risk of profit retracement.
Because in this market, the fluctuations are very large, and the people who compete are also very fierce. What we need to do is to make every transaction as possible, and we are all profitable. If we sell and find that the price is still rising, please don't feel sorry, don't consider eating all the profits.
6. When the signal appears, in most cases, even in the impact trend, it will still run a distance in the direction of the signal, that is, you will profit, so please close the position and make a profit in time. Otherwise, when the price volatility is too small, you miss the profit point, the price starts to run in the opposite direction, and you may change from profit to loss.
BITMEX's trailing stop loss is a great feature, please use it flexibly.
7, if it is a shock trend, please try not to trade.
8. We recommend that you turn on the “cryptomars 3.0” and “cryptomars 1.0” indicators. No matter who signs the trade first, you can trade, which can help you get more profit.
9. Remember, I hope this indicator will be your powerful assistant, but please don't rely on it completely. Learning more trading knowledge and skills is even more important. Therefore, when we consider the profitable position, you can use your trading skills, MACD , KDJ, etc. to assist and profit in a more suitable position.