#MT F-Channel

Author:
#MT F-Channel

Here's how the provided MetaTrader MQL script functions, explained in a way that's easy to understand without needing to know any programming:

This script is designed to automatically draw two lines on a price chart: one that acts as a potential resistance level and another that acts as a potential support level. It identifies these levels based on something called "Fractals."

Think of Fractals as specific price patterns that suggest a turning point in the market. The script looks for these patterns.

Here's the breakdown:

  1. Finding the Fractals: The script uses a built-in tool, iFractals, to locate fractal patterns on the chart. It looks for two types of fractals:

    • Upper Fractals (Resistance): These indicate potential areas where the price might struggle to go higher.
    • Lower Fractals (Support): These indicate potential areas where the price might struggle to go lower.
  2. Drawing the Lines: Once a fractal is found, the script marks the high price (for upper fractals) or the low price (for lower fractals) at that specific point. Then, it connects these points with a line. The upper fractal points are connected to form a "Resistance" line, and the lower fractal points are connected to form a "Support" line.

  3. Continuing the Lines: If a fractal isn't found at a particular point in time, the script simply extends the existing line from the previous point. This means the lines are not just connecting fractals, but are continuous lines across the chart, even where fractals are not present. The result is that the lines visually highlight potential areas where the price might encounter resistance (difficulty going up) or support (difficulty going down), based on historical fractal patterns.

Indicators Used
Fractals
Miscellaneous
Implements a curve of type %1
2 Views
0 Downloads
0 Favorites
#MT F-Channel
///+------------------------------------------------------------------+ 
// #MT F-Channel              \¦/
// Knowledge of the ancients (ò ó)
//______________________o0o___(_)___o0o__
//___¦_____¦_____¦mladen¦_____¦_____¦_____¦
//¦_cja_¦_____¦_____¦_____¦_____¦_____¦__
//___¦_____¦_____¦_____¦_Xard¦777__¦_____¦
//¦____¦ihldiaf¦_____¦_____¦_____¦____¦__
//___¦_____¦_____¦_____¦Baba¦Master_¦____¦
//¦FxSniper___¦_____¦_igor_¦_____¦_____¦__           April 18th, 2009
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//|                FractalChannel                                    |
//|                Copyright © 2004                                  |
//|                http://myweb.absa.co.za/stander/4meta/            |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DarkOrange
#property indicator_width1 2
#property indicator_color2 Blue
#property indicator_width2 2
//---- buffers
double v1[];
double v2[];
double val1;
double val2;
int i;
  
int init()
  {

  IndicatorBuffers(2);
 
//---- drawing settings
 SetIndexArrow(0, 119);
 SetIndexArrow(1, 119);
  
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2,Orange);
   SetIndexDrawBegin(0,i-1);
   SetIndexBuffer(0, v1);
   SetIndexLabel(0,"Resistance");
    

   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2,Blue);
   SetIndexDrawBegin(1,i-1);
   SetIndexBuffer(1, v2);
   SetIndexLabel(1,"Support");
 
   return(0);
  }

int start()
  {
  
   i=Bars;
   while(i>=0)
     {
   
val1 = iFractals(NULL, 0, MODE_UPPER,i);
 if (val1 > 0) 
   v1[i]=High[i];
    else
      v1[i] = v1[i+1];
  
val2 = iFractals(NULL, 0, MODE_LOWER,i);
 if (val2 > 0) 
   v2[i]=Low[i];
      else
      v2[i] = v2[i+1];

      i--;
     }   
   return(0);
  }
 
//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---