Strategy Overview: This strategy is based on a Martingale trading approach, incorporating MACD and KDJ indicators. It features pyramiding, trailing stops, and dynamic profit-taking mechanisms, suitable for both long and short trades. The strategy increases position size progressively using a Multiplier, a key feature of Martingale systems.
Key Concepts: Martingale Strategy: A trading system where positions are doubled or increased after a loss to recover previous losses with a single successful trade. In this script, the position size is incremented using a Multiplier for each addition. Pyramiding: Allows adding to existing trades when market conditions are favorable, enhancing profitability during trends.
Settings: Basic Inputs: Initial Order: Defines the starting size of the position. Default: 150.0 MACD Settings: Customize the fast, slow, and signal smoothing lengths. Default: Fast Length: 9, Slow Length: 26, Signal Smoothing: 9 KDJ Settings: Customize the length and smoothing parameters for KDJ. Default: Length: 14, Smooth K: 3, Smooth D: 3 Max Additions: Sets the number of additional positions (pyramiding). Default: 5 (Min: 1, Max: 10) Position Sizing: Percent to add to positions on favorable conditions. Default: 1.0% Martingale Multiplier: Add Multiplier: This value controls the scaling of additional positions according to the Martingale principle. After each loss, a new position is added, and its size is increased by the Multiplier factor. For example, with a multiplier of 2, each new addition will be twice as large as the previous one, accelerating recovery if the price moves favorably. Default: 1.0 (no multiplication) Can be adjusted up to 10x to aggressively increase position size after losses.
Trade Execution: Long Trades: Entry Condition: A long position is opened when the MACD line crosses over the signal line, and the KDJ’s %K crosses above %D. Additions (Martingale): After the initial long position, new positions are added if the price drops by the defined percentage, and each new addition is increased using the Multiplier. This continues up to the set Max Additions. Short Trades: Entry Condition: A short position is opened when the MACD line crosses under the signal line, and the KDJ’s %K crosses below %D. Additions (Martingale): After the initial short position, new positions are added if the price rises by the defined percentage, and each new addition is increased using the Multiplier. Exit Conditions: Take Profit: Exits are triggered when the price reaches the take-profit threshold. Stop Loss: If the price moves unfavorably, the position will be closed at the set stop-loss level. Trailing Stop: Adjusts dynamically as the price moves in favor of the trade to lock in profits. On-Chart Visuals: Long Signals: Blue triangles below the bars indicate long entries, and green triangles mark additional long positions. Short Signals: Red triangles above the bars indicate short entries, and orange triangles mark additional short positions.
Information Table: The strategy displays a table with key metrics:
Open Price: The entry price of the trade. Average Price: The average price of the current position. Additions: The number of additional positions taken. Next Add Price: The price level for the next position. Take Profit: The price at which profits will be taken. Stop Loss: The stop-loss level to minimize risk. Usage Instructions: Adjust the parameters to your trading style using the input settings. The Multiplier amplifies your position size after each addition, so use it cautiously, especially in volatile markets. Monitor the signals and table on the chart for entry/exit decisions and trade management.
ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.