ForexOFFTrend1_v1

Download script
Author: SilverTrend rewritten by CrazyChart
ForexOFFTrend1_v1

The SilverTrend indicator is designed to help traders visualize market momentum and potential trend reversals by identifying significant price boundaries. Rather than following every minor fluctuation in the market, this tool focuses on broader structural movements to provide a clearer picture of where the "ceiling" and "floor" might be at any given time.

How the Logic Works

The core functionality of this script relies on analyzing a specific window of historical data (set by the user) to identify extreme price points. Here is a breakdown of the process:

1. Identifying Highs and Lows The tool scans a predetermined number of recent bars to find the highest peak and the lowest valley. By looking at these extremes, it establishes the "trading range" for that specific period.

2. Calculating Dynamic Boundaries Instead of simply marking the absolute highest or lowest price, the script applies a percentage-based calculation. It takes the distance between the high and the low and uses two specific thresholds (the maximum and minimum percentage values provided in the settings) to project two different trend lines:

  • The logic calculates these values to create "buffer zones" relative to the current price action.
  • These zones help distinguish between a minor price correction and a significant trend change.

3. Visualizing Trend Signals The indicator plots two distinct lines on your chart:

  • Blue Line: Represents one side of the calculated trend boundary.
  • Red Line: Represents the opposing trend boundary.

4. Real-Time Decision Support The script constantly compares these two boundaries in real-time. By observing which line is currently dominant or where the price is interacting with these boundaries, traders can identify potential entry or exit points:

  • Buy Signals: When the logic detects a specific upward shift in the trend boundaries, it provides a visual "BUY" notification on the screen.
  • Sell Signals: When the logic detects a downward shift in the trend boundaries, it provides a visual "SELL" notification on the screen.

Summary for the User

Essentially, this tool acts as a sophisticated "boundary tracker." It filters out market noise by focusing on high-percentage price movements. By showing you where the price is likely to react based on recent extremes, it helps you stay aligned with the prevailing trend while highlighting the moments when that trend might be reaching its limit.

Miscellaneous
Implements a curve of type %1
12 Views
0 Downloads
0 Favorites
ForexOFFTrend1_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                 SilverTrend .mq4 |
//|                             SilverTrend  rewritten by CrazyChart |
//|                                                 http://viac.ru/  |
//+------------------------------------------------------------------+
#property copyright "SilverTrend  rewritten by CrazyChart"
#property link      "http://viac.ru/ "

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

//---- input parameters
extern int       CountBars=300;
extern int       SSP=7;
extern double    Kmin=1.6;
extern double    Kmax=50.6; //24 21.6 21.6 

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(2);

   SetIndexStyle(0,DRAW_LINE,0,1,Blue);
   SetIndexBuffer(0,ExtMapBuffer1);

   SetIndexStyle(1,DRAW_LINE,0,1,Red);
   SetIndexBuffer(1,ExtMapBuffer2);

   return(0);
  }


//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   if (CountBars>=Bars) CountBars=Bars;

   SetIndexDrawBegin(0,Bars-CountBars+SSP);
   SetIndexDrawBegin(1,Bars-CountBars+SSP);

   int i, i2,loopbegin,counted_bars=IndicatorCounted();
   double SsMax, SsMin, K, val1, val2, smin, smax, price; 
  
   if(Bars<=SSP+1) return(0);
 
//K=33-RISK; 

/*
if (firstTime==true)   { 
   loopbegin = CountBars; 
   if (loopbegin>(Bars-2*SSP+1)) loopbegin=Bars-2*SSP+1; 
   firstTime=False; 
}; ðóäèìåíò ñòàðîé ïðîãðàììû 
*/

//+++++++-SSP
   if(counted_bars<SSP+1)
     {
      for(i=1;i<=SSP;i++) ExtMapBuffer1[CountBars-i]=0.0;
      for(i=1;i<=SSP;i++) ExtMapBuffer2[CountBars-i]=0.0;
     }
//+++++++-SSP


   for(i=CountBars-SSP;i>=0;i--)
     { 
      SsMax = High[Highest(NULL,0,MODE_HIGH,SSP,i-SSP+1)]; 
      SsMin = Low[Lowest(NULL,0,MODE_LOW,SSP,i-SSP+1)]; 
      smin = SsMin-(SsMax-SsMin)*Kmin/100; 
      smax = SsMax-(SsMax-SsMin)*Kmax/100;  
      ExtMapBuffer1[i-SSP+6]=smax; 
      ExtMapBuffer2[i-SSP-1]=smax; 
      val1 = ExtMapBuffer1[0]; 
      val2 = ExtMapBuffer2[0]; 
      if (val1 > val2) Comment("BUY  ",val1); 
      if (val1 < val2) Comment("SELL ",val2); 
     }
   return(0);
  }

Comments