ASCTrend1sig_noSound_v2

Download script
ASCTrend1sig_noSound_v2

This technical tool is designed to assist traders by identifying specific trend signals on a price chart. Rather than simply following every small movement in the market, it employs a logic-driven approach to filter out "noise" and pinpoint significant shifts in momentum.

Core Mechanism

The script functions by analyzing the relationship between current price action and historical volatility. It looks at several key factors to determine if a trend is truly forming or if the market is merely fluctuating sideways:

  • Volatility Assessment: The tool calculates the average range of price movement over a specific window. This allows it to understand what "normal" price activity looks like for that specific asset at any given time.
  • Momentum Scanning: It scans backward through recent history to find significant price "breaks." It specifically looks for instances where the price moved significantly more than the average range, which helps the tool distinguish between a random tick and a meaningful trend shift.
  • Dynamic Sensitivity: The script uses a "Risk" parameter that adjusts its internal sensitivity. By modifying these values, the tool can be made more aggressive (identifying smaller signals) or more conservative (filtering for only major movements).

Signal Generation Logic

The tool identifies potential buy and sell opportunities based on how quickly price momentum is moving relative to its boundaries:

  1. Trend Filtering: It calculates a percentage-based indicator to see where the current price sits in relation to recent extremes.
  2. Breakout Confirmation: A signal is not triggered just because a price hits a certain level. Instead, the tool "looks ahead" (mathematically) to ensure that the momentum has crossed a specific threshold and stayed outside of a neutral zone.
  3. Visual Indicators:
    • When the logic confirms a downward momentum shift, it places a visual marker below the candle.
    • When the logic confirms an upward momentum shift, it places a visual marker above the candle.

Summary for the User

In plain terms, this script acts as a sophisticated filter. It measures how much "power" is behind a price move by comparing it to recent volatility. If a move is strong enough and breaks out of the current trading range with sufficient momentum, the tool places a visual signal on your chart to alert you to the potential trend change.

Indicators Used
Larry William percent range indicator
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
ASCTrend1sig_noSound_v2
//+------------------------------------------------------------------+
//| ASCTrend1sig_noSound.mq4 
//| Ramdass - Conversion only
//+------------------------------------------------------------------+

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Yellow
#property indicator_color2 Yellow

//---- input parameters
extern int RISK=5;//3 as Default
extern int CountBars=1000; //300
extern int SoundON=1;
extern int EmailON=0;

//---- buffers
double val1[];
double val2[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,108);  //(0.234)
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,108);  //(1.233) Hercs het verander na Kolletjies 8 November 2005
   SetIndexBuffer(0,val1);
   SetIndexBuffer(1,val2);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| ASCTrend1sig                                                     |
//+------------------------------------------------------------------+
int start()
  {
   if (CountBars>=1000) CountBars=950;
   SetIndexDrawBegin(0,Bars-CountBars+11+1);
   SetIndexDrawBegin(1,Bars-CountBars+11+1);
   int i,shift,counted_bars=IndicatorCounted();
   int Counter,i1,value10,value11;
   double value1,x1,x2;
   double value2,value3;
   double TrueCount,Range,AvgRange,MRO1,MRO2;
   double Table_value2[1000];
   
   value10=3+RISK*2;
   x1=67+RISK;
   x2=33-RISK;
   value11=value10;
//----
   if(Bars<=11+1) return(0);
//---- initial zero
   if(counted_bars<11+1)
   {
      for(i=1;i<=0;i++) val1[CountBars-i]=0.0;
      for(i=1;i<=0;i++) val2[CountBars-i]=0.0;
   }
//----
   shift=CountBars-11-1;
   while(shift>=0)
     {
     
   Counter=shift;
	Range=0.0;
	AvgRange=0.0;
	for (Counter=shift; Counter<=shift+9; Counter++) AvgRange=AvgRange+MathAbs(High[Counter]-Low[Counter]);
		
	Range=AvgRange/10;
	Counter=shift;
	TrueCount=0;
	while (Counter<shift+9 && TrueCount<1)
		{if (MathAbs(Open[Counter]-Close[Counter+1])>=Range*2.0) TrueCount=TrueCount+1;
		Counter=Counter+1;
		}
	if (TrueCount>=1) {MRO1=Counter;} else {MRO1=-1;}
	Counter=shift;
	TrueCount=0;
	while (Counter<shift+6 && TrueCount<1)
		{if (MathAbs(Close[Counter+3]-Close[Counter])>=Range*4.6) TrueCount=TrueCount+1;
		Counter=Counter+1;
		}
	if (TrueCount>=1) {MRO2=Counter;} else {MRO2=-1;}
	if (MRO1>-1) {value11=3;} else {value11=value10;}
	if (MRO2>-1) {value11=4;} else {value11=value10;}
	value2=100-MathAbs(iWPR(NULL,0,value11,shift)); // PercentR(value11=9)
	Table_value2[shift]=value2;
	val1[shift]=0;
	val2[shift]=0;
	value3=0;
	if (value2<x2)
		{i1=1;
		while (Table_value2[shift+i1]>=x2 && Table_value2[shift+i1]<=x1){i1++;}
		if (Table_value2[shift+i1]>x1) 
			{
			value3=High[shift]+Range*0.5;
			val1[shift]=value3;
			} 
		}
	if (value2>x1)
		{i1=1;
		while (Table_value2[shift+i1]>=x2 && Table_value2[shift+i1]<=x1){i1++;}
		if (Table_value2[shift+i1]<x2) 
			{
			value3=Low[shift]-Range*0.5;
			val2[shift]=value3;
			}
		}
      
      shift--;
     }

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


Comments