Technical Indicator

Maximize Your Trading Success with the EquiPeak Drawdown Tracker for MetaTrader 5
MetaTrader5
Maximize Your Trading Success with the EquiPeak Drawdown Tracker for MetaTrader 5

What’s It All About? Visual Benchmark of Your EAs’ Performance: Easily input the expected Historical Maximum Drawdown from your backtesting or past results. This gives you a solid reference to see if your EA is performing within expected limits or if it’s straying into uncertain territory. Real-Time Risk Monitoring: Keep an eye on your current drawdown in real time, ensuring you catch critical levels that need your immediate attention. Smart Notifications: The tracker sends you push notifications through the MetaTrader app on your phone whenever a new drawdown record is reached. You can also set it to update you periodically, so you stay informed without being bombarded by messages. Automatic Logging: It logs drawdown data to an external file (CSV or TXT) for you to analyze later, making it easier to keep track of your performance over time. Who Can Benefit? Traders using automated or semi-automated systems who want a quick snapshot of their EA's performance against the expected maximum drawdown. Anyone who needs a clear visual of how their strategies perform under live market conditions compared to their backtest results. Traders looking to manage their risk effectively and be alerted when their trading exceeds acceptable drawdown limits. Configuration Guide: Customize Your Inputs Here’s a breakdown of all the customizable parameters for the indicator: Magic Numbers to Monitor: Specify the magic numbers for the positions you want to track. Enter -1 to monitor all positions. Initial Max DD (%): Input your EA's historical maximum drawdown here. This figure serves as a visual benchmark. Refresh Interval (seconds): Set how often you want the calculations to update. MaxDD Update Mode: Choose how the all-time high is updated: UPDATE_MAX_DD_IF_BIGGER: Automatically updates if the current drawdown exceeds the historical one. NO_UPDATE_MAX_DD: Keeps the historical value unchanged but sends hourly notifications about the current status. Send Push Notifications? Toggle to enable or disable mobile notifications. Fixed or Peak Reference? Decide how to set your balance reference: REF_FIXED_BALANCE: A manually entered fixed balance. REF_PEAK_BALANCE: Automatically uses the highest balance reached. Fixed Balance (0 => current): Enter your initial fixed balance. If you input 0, it uses the current balance when loading the indicator. Current DD Text Color: Choose the color for displaying current drawdown. Max DD Text Color: Set the color for the historical drawdown text. Font Size (Current DD): Adjust the font size for current drawdown text. Font Size (Max DD): Adjust the font size for historical drawdown text. Labels Behind Chart? Option to place texts behind the graphic. Label X (pixels): Set horizontal distance from the left edge. Label Y (pixels): Set vertical distance from the top edge. Vertical Spacing: Control the vertical space between texts. Print Logs in Journal? Enable detailed messages in the Journal. Enable File Log: Automatically tracks the current drawdown in an external file. File Extension (CSV or TXT): Choose the format for your log files. Automatic File Registration Your drawdown values are logged automatically with timestamps in either CSV or TXT format, stored in the MT5 common folder (MetaTrader 5 Terminal/Common/Files/). This is perfect for future analysis of your trading results. Top Tips for Getting the Most Out of It Always input your expected Historical Maximum Drawdown in the Initial Max DD (%) field. This helps you quickly determine if your EA is functioning normally or if adjustments are needed. Place the indicator on a dedicated chart that monitors all magic numbers, or distribute it across individual charts for specific data. Adjust the refresh rate, colors, positions, and text sizes to your liking for optimal visibility. Setting Up Push Notifications Open the MetaTrader mobile app and copy your MetaQuotes ID (found under Settings > Messages). On the desktop version of MetaTrader 5, navigate to Tools > Options > Notifications. Enable Push Notifications and paste your MetaQuotes ID to start receiving alerts.

2025.04.14
Unlocking Kuskus Starlight: Your Go-To MT5 Indicator for Market Trends
MetaTrader5
Unlocking Kuskus Starlight: Your Go-To MT5 Indicator for Market Trends

Indicator Name: Kuskus Starlight Description: Kuskus Starlight is a powerful technical indicator that operates as an oscillator. It employs a Fisher price transformation to help traders pinpoint potential market trends and reversals. The indicator is normalized over a specific range of periods, with adjustable smoothing parameters, so you can fine-tune its responsiveness to suit your trading style. Many traders appreciate it as a confirmation tool, validating trade signals within their systems. Background:I stumbled upon the Kuskus Starlight indicator through Stonehill Forex and the popular No Nonsense Forex (NNFX) YouTube channel. Both have showcased its effectiveness as a confirmation indicator in their trading frameworks. According to Stonehill Forex, this indicator has been around since 2007, while NNFX notes that it gained traction in 2017. For more in-depth insights and applications of the Kuskus Starlight indicator, check out these resources: Stonehill Forex's article: Kuskus Starlight as a Confirmation Indicator NNFX's YouTube video: Kuskus Starlight Indicator Why I Coded It:As a MetaTrader 5 (MT5) user, I found there was no version of the Kuskus Starlight indicator available for MT5. Realizing its potential for traders using this platform, I took it upon myself to code it, ensuring that it maintains the original algorithm's functionality and integrity. Original MT4 Code and Algorithm:The original version of this indicator was created for MetaTrader 4 (MT4) by Scriptor and can be found here. My MT5 adaptation is based on this code, preserving its core principles while making it accessible to the MT5 community. I genuinely hope the MT5 version of Kuskus Starlight adds value to your trading toolkit! Indicator Settings: DrawType Options DrawType Options: Line DrawType Options: Histogram DrawType Options: StaryStaryNight Arrow Type Options: Choose from many arrow types

2025.04.14
Mastering the Chande Kroll Stop Indicator for MetaTrader 5
MetaTrader5
Mastering the Chande Kroll Stop Indicator for MetaTrader 5

The Chande Kroll Stop indicator is a handy tool for setting your stop loss levels in trading. It charts two lines on your price graph that help signal when it might be time to close your positions. Long Position Line (Green): This line indicates where you should set your stop loss for long positions. If the asset's price begins to drop and hits this line, it’s often a good signal to close your buy orders. Short Position Line (Red): Conversely, this line marks the point for closing short positions. If the price starts to rise and touches this line, it could be a cue to exit your sell orders. The Chande Kroll Stop is calculated using the true range, making it a versatile indicator that works well regardless of market volatility. It was popularized in Tushar Chande and Stanley Kroll's book, "The New Technical Trader." Designed for trend-following strategies, this indicator helps traders identify stop levels by measuring the average true range of market trends while factoring in volatility. This indicator operates by analyzing the maximum and minimum price values over a specified period and incorporating the standard deviation (ATR). This way, it adapts to the current market conditions, helping you stay in tune with the price action. Market volatility plays a crucial role in how the Chande Kroll Stop functions. When volatility is high, the stop lines are positioned further away from the current price, giving traders more breathing room for fluctuations. On the flip side, during low volatility periods, these lines come closer to the price, enabling traders to react swiftly to any market changes.

2025.04.10
Understanding PriceChanges: A Must-Have Indicator for MetaTrader 5
MetaTrader5
Understanding PriceChanges: A Must-Have Indicator for MetaTrader 5

Hey traders! If you’re looking for a nifty tool to keep tabs on price movements in MetaTrader 5, you’ll want to check out the PriceChanges indicator. This handy multi-symbol indicator allows you to visualize price changes of various symbols right from your Market Watch, and it does so between two dates marked by vertical lines. What’s great about this feature is that it gives you a quick and easy way to assess how much different currencies have moved, helping you get a clearer picture of the market dynamics at play. This can be a game-changer when it comes to making informed trading decisions. Managing the Indicator Managing the dates in the PriceChanges indicator is a breeze! You can easily adjust them using your mouse, and you can also navigate through the display using your keyboard. Here are some key shortcuts you’ll find handy: KEY_C: Press C to switch symbols. NUMPAD_0: Use 0 on the numpad for quick access. OPEN_BRACKET: Press [ to open a symbol. CLOSE_BRACKET: Press ] to close a symbol. This functionality allows you to swiftly toggle between different symbols, enhancing your overall trading experience. Trust me, you’ll notice the difference once you start using it! Features of PriceChanges One of the best parts about this indicator is that it restarts automatically at startup and also resets when you switch symbols. This means you can focus on your trading without worrying about constant manual adjustments. Give PriceChanges a try, and see how it can help streamline your trading process!

2025.04.10
Mastering the Uniformity Factor Indicator for MetaTrader 5
MetaTrader5
Mastering the Uniformity Factor Indicator for MetaTrader 5

Hey fellow traders! Today, we're diving into the Uniformity Factor Indicator for MetaTrader 5. This handy tool is perfect for anyone looking to analyze the price timeseries and test the hypothesis that it behaves like a 'random walk'—specifically, a Gaussian 'random walk.' So, why does this matter? Understanding the concept of a 'random walk' is key. In simple terms, after N steps, the expected distance covered is roughly estimated by its standard deviation multiplied by the square root of N (or N^0.5). This can provide insights into price movements that can help you make more informed trading decisions. The Uniformity Factor Indicator calculates the average price change per bar across predefined bar ranges. It does this by averaging based on a distance taken to the power of F, where F varies from 0.1 to 1 in increments of 0.1. This means you can tailor your analysis for more precise results. All the bars available on your current chart are utilized for gathering statistics in sliding windows up to N bars. The indicator then determines the most 'regular' or uniform distribution of the statistics among different F values, typically landing around 0.5 or 0.6. Each column in the resulting histogram represents the average delta of points per bar for corresponding trade durations, with the averaging conducted by N^F (setting F=1 gives you standard averaging). Now, let’s talk about the methods the indicator uses for detecting 'regularity' or flatness in the statistical curve: Minimum variance Minimum difference between the triple M's (Mean, Median, Mode), calculated as squared error Minimum Gini coefficient Knowing the optimal factor can be a game changer for: Normalizing input data (like price changes) for neural networks and other machine learning algorithms Estimating the minimum number of bars needed for sampling into a single input vector for volatility trading systems Detecting symbols or timeframes with anomalies (like non-standard F values or singularities in the distribution curve) Inputs Period: This is the maximum distance in bars (N) for collecting price range statistics, with a default of 200. Factor: This is the exponent for averaging over distances. The default is set to 0 for auto-detection. You can also enter a custom value between 0.0 and 1.0, like 0.525. Method: Choose one of the estimation methods for uniformity: variance, triple_M, or Gini. MaxBars: This limits the number of bars for calculating statistics, set to 0 by default—meaning all available bars will be used. Note: If you opt for an unlimited number of bars or hundreds of thousands on your chart, calculations may take a bit longer. If that’s a concern, consider limiting the bars to tens of thousands. Outputs The indicator displays a blue histogram showing the average price change per bar for each distance in the range (1..Period) and for the selected uniformity factor. Additionally, a continuously increasing number of bars (distance) is represented as a second histogram (orange) for your reference. A complete table of tested factors and corresponding metrics of the current timeseries is logged for your convenience. XAGUSD.c D1, Max.Distance: 500, Bars: 2641 Factor: 0.4, Result: var(0.4) mmm(0.4) gini(0.4)*     [factor]  [mean] [variance] [skewness] [kurtosis] [median]  [mode] [mmmse]  [gini] [0]  0.10000 1.85217    0.21976   -0.87694    0.07751  1.95822 2.30853 0.33811 0.13930 [1]  0.20000 1.07575    0.04083   -1.12699    0.96219  1.12715 1.25786 0.13285 0.10093 [2]  0.30000 0.62887    0.00525   -1.54472    3.00927  0.64878 0.68616 0.04114 0.05943 Screenshots Check out these screenshots showing the indicator across three different timeframes: D1, H1, and M1. Each chart features two instances of the indicator: The upper one is set for F auto-detection using the Gini method, with the detected value displayed in the title (marked with an asterisk). The lower one is configured for a predefined F=0.6. 2 indicators Uniformity Factor on XAGUSD,D1 2 indicators Uniformity Factor on XAGUSD,H1 2 indicators Uniformity Factor on XAGUSD,M1

2025.04.07
Understanding the Pan PrizMA No Leverage 72 Indicator for MetaTrader 5
MetaTrader5
Understanding the Pan PrizMA No Leverage 72 Indicator for MetaTrader 5

Welcome aboard, fellow traders! Today, we're diving into the Pan PrizMA No Leverage 72 indicator tailored for MetaTrader 5. This powerful tool is designed to enhance your trading experience by creating a dynamic sliding line based on a four-degree polynomial interpolation.The magic happens as this line extrapolates with a sine wave, pulling in key values from the line_poweraxial, or a nearly constant slant with the power_line set to 3. This feature allows the indicator to redraw the graph for a clearer visual representation.What’s more, from the constructed and axial sinusoids, one value from each bar is removed, resulting in a line of extrapolated values that never redraws. This means you get a consistent view of market dynamics without second-guessing yourself.External Variables Explained:line_power: This variable denotes the degree of the extrapolated line.leverage: It sets the elimination values for the resultant line, leveraging from the first sliding line shifted backwards.multiplier: This allows for adjustment of values. If set to zero, it removes values from the axial; if one, it operates from the sinusoid; and if minus one, it reflects through the axial from the mirror sinusoid point. It can accept any value!line4_SHIFT: This variable indicates the line shift resulting from the extrapolated values.interval: This increases the average multiple for better accuracy.If you want to delve deeper into this indicator, check out our community discussions on calculation of differences and examples.

2025.04.04
Discover the PSAR Zigzag: A Non-Lagging Indicator for MetaTrader 5
MetaTrader5
Discover the PSAR Zigzag: A Non-Lagging Indicator for MetaTrader 5

Unveiling the PSAR Zigzag Indicator If you’re familiar with the traditional zigzag indicator, you know it primarily highlights past market swings and often lags behind the action. This lagging nature can make it a bit tricky for traders aiming to spot real-time signals. The traditional zigzag is more of a tool for analyzing historical pivot points rather than a reliable trend-following indicator. Enter the PSAR Zigzag! This isn't just any zigzag; it's a dynamic, trend-based indicator that offers no lag up to the current price bar. Built on the Parabolic Stop and Reverse (PSAR) trend-following algorithm, this zigzag was designed with the intent to eliminate lag altogether. In the past, we’ve seen zigzags based on PSAR, but they often produced delayed and invalid signals. Why settle for lag when we can have a real-time indicator? How It Works The PSAR Zigzag utilizes a backstep feature to ensure the validity of its legs. When identifying a high, it calculates the highest point based on a defined number of lookback bars—similarly for lows. This means that the zigzag can often swing at recent highs or lows, or at significant support and resistance levels. While the PSAR can struggle in ranging markets, this zigzag structure has been fine-tuned for clarity and efficiency. Latest Versions v1: Links swings from candle highs or lows, or the support and resistance identified through the backstep. v2: Strictly connects the legs to candle highs and lows at the swing points. v3: Introduces forward step logic for ultimate control of the zigzag. I hope you find this PSAR Zigzag indicator as intriguing as I do. It’s the result of thoughtful experimentation aimed at improving your trading experience. Check it out below!

2025.04.01
Mastering the SuperTrend Indicator for MetaTrader 5: A Trader's Guide
MetaTrader5
Mastering the SuperTrend Indicator for MetaTrader 5: A Trader's Guide

If you're looking to sharpen your trading edge, the SuperTrend indicator is a valuable tool to have in your arsenal. It helps you spot market trends by leveraging Average True Range (ATR) volatility, making it a go-to for many traders. Plus, it's available for free under the MIT license, so you can use it without any strings attached! Core Formula Upper Band: Source Price + (Multiplier × ATR) Lower Band: Source Price - (Multiplier × ATR) In an uptrend: SuperTrend = Lower Band (green) In a downtrend: SuperTrend = Upper Band (red) How to Use the SuperTrend Indicator The green line shows an uptrend, signaling potential buying opportunities. The red line indicates a downtrend, which can point to potential selling opportunities. It's versatile; you can use it for trend-following strategies or to identify market reversals. Additionally, it works excellently as a trailing stop mechanism. Installing the SuperTrend Indicator Copy the SuperTrend file into your MetaTrader 5 indicators folder (usually found at Terminal_Directory/MQL5/Indicators/). Restart your MetaTrader 5 or refresh the Navigator panel to see the changes. Simply drag the indicator onto any chart to get started! Key Parameters ATRPeriod: This defines the period for ATR calculation (default is 22). Multiplier: Adjusts sensitivity of the indicator (default is 3.0). SourcePrice: The type of price used for calculations. TakeWicksIntoAccount: Determines whether to include price wicks in the calculations.

2025.03.15
Mastering the T3 Moving Average: A Comprehensive Guide for MetaTrader 5
MetaTrader5
Mastering the T3 Moving Average: A Comprehensive Guide for MetaTrader 5

If you're looking to step up your trading game, the T3 Indicator is a powerful tool you won't want to miss. Developed by Tim Tillson, this advanced moving average minimizes lag while providing a smooth curve that effectively filters out market noise. Unlike traditional moving averages, the T3 utilizes a mix of multiple exponential moving averages (EMAs) to deliver enhanced responsiveness to real price movements. How the T3 is Calculated The T3 is derived from a series of six exponential moving averages, weighted according to a volume factor. Here’s a quick rundown of how it's calculated: First, calculate six sequential EMAs, with each one using the previous EMA's output as its input. Next, the T3 formula combines these EMAs using coefficients based on the volume factor: T3 = c1*EMA6 + c2*EMA5 + c3*EMA4 + c4*EMA3 Where: c1 = -factor³ c2 = 3factor² + 3factor³ c3 = -6factor² - 3factor - 3*factor³ c4 = 1 + 3factor + factor³ + 3factor² Input Parameters for the T3 T3_Length: This sets the period length for the EMAs (default is 12). T3_Factor: The volume factor that adjusts the balance between smoothness and responsiveness (default is 0.7). Higher values (closer to 1) yield smoother lines but with more lag. Lower values (closer to 0) produce more responsive lines with less lag. How to Use the T3 Indicator The T3 Indicator can be a game-changer when it comes to: Identifying trends (look at the direction of the T3 line) Generating trading signals (watch for price crossing the T3 line) Pinpointing support and resistance levels Filtering out short-term market noise Installation Instructions Getting started with the T3 is simple. Just place the file in your MetaTrader 5 indicators folder, attach it to any chart, and tweak the input parameters to fit your trading style and timeframe.

2025.03.11
Mastering the Fibonacci ZigZag Indicator for MetaTrader 5
MetaTrader5
Mastering the Fibonacci ZigZag Indicator for MetaTrader 5

Getting Started with the Fibonacci ZigZag Indicator To set up the Fibonacci ZigZag indicator in MetaTrader 5, you'll need the following components: 1 zigzag plot 2 data buffers for tracking highs and lows Input parameters for customization A set of system variables that reset during recalculations Here’s a snippet of the code you’ll be working with: #property indicator_buffers 2 #property indicator_plots 1 input double retracement=23.6;// Retracement amount input double minSizeInAtrUnits=0.0;// Minimum size of waves in ATR units input int rollingAtrPeriod=14;// Rolling ATR period input color Color=clrDodgerBlue;// Wave color input int Width=3;// Wave width input ENUM_LINE_STYLE Style=STYLE_SOLID;// Wave style //+------------------------------------------------------------------+ In this setup, the upWaves array will hold the highs, while the dwWaves array captures the lows. Next, let's define our system variables. We need to track the last wave type, where it began and ended, and the bar distances from each point: //--- Managing the zigzag   //--- Wave types: [0] None, [1] Up, [2] Down     int wave_type=0;   //--- Starting price of the wave     double wave_start_price=0.0;   //--- Ending price of the wave     double wave_end_price=0.0;   //--- Distance in bars from starting price     int wave_start_distance=0;   //--- Distance in bars from ending price     int wave_end_distance=0;   //--- High price tracking     double high_mem=0.0;     int distance_from_high=0;   //--- Low price tracking     double low_mem=0.0;     int distance_from_low=0;   //--- Rolling ATR     double rollingAtr=0.0;        int rollingAtrs=0; This sets up the rolling ATR unit and keeps track of how many have been calculated. Next, we’ll create a system reset function to clear out old data: void resetSystem(){ ArrayFill(upWaves,0,ArraySize(upWaves),0.0); ArrayFill(dwWaves,0,ArraySize(dwWaves),0.0); wave_type=0; wave_start_price=0.0; wave_end_price=0.0; wave_start_distance=0; wave_end_distance=0; high_mem=0.0; low_mem=0.0; distance_from_high=0; distance_from_low=0; rollingAtr=0.0; rollingAtrs=0; } Here we simply fill the arrays with zeroes and reset the system variables. During initialization, we set up the buffers, the plot, and call reset for the first time:   SetIndexBuffer(0,upWaves,INDICATOR_DATA);   SetIndexBuffer(1,dwWaves,INDICATOR_DATA);    PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0.0);    PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_ZIGZAG);    PlotIndexSetInteger(0,PLOT_LINE_COLOR,0,Color);    PlotIndexSetInteger(0,PLOT_LINE_WIDTH,Width);    PlotIndexSetInteger(0,PLOT_LINE_STYLE,Style);   resetSystem(); Now, let’s dive into the calculations. First on our list is managing the rolling ATR. We won’t proceed until we have more bars than the ATR period: If we haven't collected enough bars, we keep adding the range of the found bars to a summation. Once we have enough bars, we perform our first division (averaging). After that, we clip one portion of the rolling ATR and add a new portion based on the current bar's range. We do this first to minimize accessing multiple conditions.      //--- Manage the ATR        rollingAtrs++;        if(rollingAtrs>rollingAtrPeriod){        double new_portion=((high[i]-low[i])/_Point)/((double)rollingAtrPeriod);        //--- Remove an old portion and add a new one        rollingAtr=(rollingAtr)-(rollingAtr/((double)rollingAtrPeriod))+new_portion;        }        else if(rollingAtrs<=rollingAtrPeriod){          rollingAtr+=(high[i]-low[i])/_Point;          if(rollingAtrs==rollingAtrPeriod){            rollingAtr/=((double)rollingAtrs);            //--- Initialize memory for highs and lows              high_mem=high[i];              low_mem=low[i];              distance_from_high=0;              distance_from_low=0;          }        } Now, there's an important point to consider. For a retracement to take place, we need at least one wave. But how do we define that first wave? Here’s how: Once the ATR fills up (i.e., we’ve collected the period), we’ll capture the high and low in our system variables. Whichever side forms a wave with a valid size in ATR units, forming a new high (upwave) or a new low (downwave), is the winner! This way, we avoid having a retracement as the initial wave, but it’s still a necessary step to kick things off. Here’s how we handle things when there’s no wave yet:    //--- If there's no wave type yet      else{        //--- If we break the high but not the low          if(high[i]>high_mem&&low[i]>=low_mem){            double new_wave_size_in_atr_units=((high[i]-low_mem)/_Point)/rollingAtr;          //--- Check if the new wave size is valid          if(new_wave_size_in_atr_units>=minSizeInAtrUnits){              //--- Start a new up wave                wave_type=1;                wave_start_price=low_mem;                wave_start_distance=distance_from_low;                wave_end_price=high[i];                wave_end_distance=0;                //--- Draw the wave                dwWaves[i-wave_start_distance]=low_mem;                upWaves[i]=high[i];                //--- Update the high                high_mem=high[i];                distance_from_high=0;                //--- Update the low                low_mem=low[i];                distance_from_low=0;            }        }        //--- If we break the low but not the high          else if(low[i]<low_mem&&high[i]<=high_mem){          double new_wave_size_in_atr_units=((high_mem-low[i])/_Point)/rollingAtr;          //--- If the new wave size is valid          if(new_wave_size_in_atr_units>=minSizeInAtrUnits){            //--- Start a new down wave              wave_type=-1;              wave_start_price=high_mem;              wave_start_distance=distance_from_high;              wave_end_price=low[i];              wave_end_distance=0;              //--- Draw the wave              upWaves[i-wave_start_distance]=high_mem;              dwWaves[i]=low[i];              //--- Update the high              high_mem=high[i];              distance_from_high=0;              //--- Update the low              low_mem=low[i];              distance_from_low=0;        }        }        //--- If we break both high and low          else if(low[i]<low_mem&&high[i]>high_mem){          //--- Update both values          high_mem=high[i];          low_mem=low[i];          distance_from_high=0;          distance_from_low=0;        }      } Now, let’s wrap things up. If we have an upwave: If a new high is made, move the zigzag from the previous high position to the new one. This allows us to retain bar distances and capture the lowest low since the peak for potential retracement. If a new low is made, we calculate the distance from the peak to the low, divide it by the wave size, and scale it to match the input parameter. If the new wave size meets the ATR criteria, we start a new downwave, updating local highs and lows as well as distances. Here’s the relevant code:        //--- If we have an up wave          if(wave_type==1){            //--- If the wave expands upwards              if(high[i]>wave_end_price){                //--- Remove the previous end price from its array position (0.0=empty)                 upWaves[i-wave_end_distance]=0.0;                //--- Place it on the new position                 upWaves[i]=high[i];                wave_end_price=high[i];                wave_end_distance=0;                //--- Update the high                high_mem=high[i];                distance_from_high=0;                //--- Update the low                low_mem=low[i];                distance_from_low=0;          }            //--- Check for retracement              if(low[i]<low_mem||distance_from_low==0){                low_mem=low[i];                distance_from_low=0;                double size_of_wave=(wave_end_price-wave_start_price)/_Point;                double size_of_retracement=(wave_end_price-low_mem)/_Point;                if(size_of_wave>0.0){                  double retraced=(size_of_retracement/size_of_wave)*100.0;                  double new_wave_size_in_atr_units=((wave_end_price-low_mem)/_Point)/rollingAtr;                //--- If the new wave size is valid                if(new_wave_size_in_atr_units>=minSizeInAtrUnits){                  //--- If the retracement is significant, start a down wave                   wave_type=-1;                   wave_start_price=high[i-distance_from_high];                   wave_start_distance=distance_from_high;                   wave_end_price=low[i];                   wave_end_distance=0;                  //--- Draw the wave                 upWaves[i-wave_start_distance]=high_mem;                 dwWaves[i]=low[i];                  //--- Update the high                 high_mem=high[i];                 distance_from_high=0;                  //--- Update the low                 low_mem=low[i];                 distance_from_low=0;          }          }        }        }        }        } We’ll do the opposite for a down wave. And just like that, our retracement zigzag is set up and ready to roll! Take a look at the zigzag with 23.6% retracement and 0.0 min size of waves in ATR units: And here's the same zigzag with 3 min size of waves in ATR units: Happy trading!

2025.03.03
First Previous 3 4 5 6 7 8 9 10 11 12 13 Next Last