zzf-convertido

Author: Chris Battles
zzf-convertido

This script is designed to create a visual representation of specific price levels on your trading chart. Instead of showing every minor fluctuation in the market, it identifies and connects significant structural turning points to help clarify the overall trend.

How the Logic Works

The core functionality of this tool relies on identifying "peaks" and "troughs" in the market data. It operates using the following logic:

  • Identifying Key Milestones: The script communicates with a secondary technical tool (a "ZigZag-Fractals" indicator) to locate significant price highs and lows. These are points where the market direction has clearly shifted rather than just fluctuated momentarily.
  • Connecting the Dots: Once these key milestones are identified, the script tracks their values. If a new significant high or low is detected, the tool records that price point.
  • Maintaining Continuity: In areas where the market is moving between two major peaks or troughs (the "noise" in between), the script carries over the value of the previous milestone.

The Visual Result

By connecting these identified points, the script draws a solid line on your chart that reflects the structural movement of the currency pair. It essentially filters out the daily market noise to highlight the primary "skeleton" of the price action, allowing you to see the major channels and trend shifts more clearly.

15 Views
0 Downloads
0 Favorites
zzf-convertido
//+------------------------------------------------------------------+
//|                                                   FX-CHANNEL.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Chris Battles"
#property link      "mailto:cbattles@neo.rr.com"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Gold
  
//---- buffers
double v1[];


//----
double val1;


int k;

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+  
  int
init () 
{
  
//---- drawing settings
    
//----   
    SetIndexStyle (0, DRAW_SECTION, STYLE_SOLID, 1);
  
SetIndexDrawBegin (0, k);
  
SetIndexBuffer (0, v1);
  
SetIndexLabel (0, "UPPER");
  
//----
    
//----
    return (0);

}


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
  int
start () 
{
  


k = Bars;
  

while (k >= 0)
    
    {
      
val1 = iCustom (NULL, 0, "ZIGZAG-FRACTALS", 0, k);
      
if (val1 > 0)
	
v1[k] = val1;
      
      else
	
v1[k] = v1[k + 1];
      

k--;
    
}
  
return (0);

}



//+------------------------------------------------------------------+

Comments