Author: Chris Battles
zzf

Tool Overview

The FX-CHANNEL script is a visual trading tool designed for the MetaTrader 4 platform. Its primary purpose is to identify and plot significant structural levels on your price chart, specifically highlighting historical "peaks" or turning points in market movement. By visualizing these key areas, it helps traders better understand the zones where price has historically reacted or reversed.

How the Logic Works

The script operates by analyzing historical price action through the following logic:

  • Data Source Integration: The tool does not generate its own raw data from scratch. Instead, it "listens" to a secondary technical indicator called "ZIGZAG-FRACTALS." It looks for specific geometric patterns in the market—points where the price has shifted direction significantly enough to be considered a major structural landmark.
  • Peak Identification: The script scans through your entire trading history, looking for these fractal high points. Whenever it detects a valid peak from the source indicator, it captures that specific price value.
  • Trend Continuity (The "Step" Effect): This is the core behavior of the tool. Rather than just showing isolated dots at every turning point, the script creates a continuous visual line.
    • If the script finds a new peak at a specific point in time, it plots that price.
    • If there is no new peak at a certain point, the script carries forward (retains) the value of the previous peak.
  • Visual Representation: By carrying over the last known peak value until a new one is found, the tool creates a horizontal "staircase" effect on your chart. This allows you to see exactly which price level was the most recent significant high, providing a clear visual boundary of the current market structure.

Summary for Traders

In practical terms, this script transforms complex fractal data into a clean, readable line on your chart. It eliminates "market noise" by ignoring minor fluctuations and instead draws a line that stays flat until the price breaks out to form a new significant high. This helps you quickly identify major resistance levels at a glance.

Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
zzf
//+------------------------------------------------------------------+
//|                                                   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