nd1Sig_v1

Overview of the Trading Logic

This script is designed as a visual trading indicator for MetaTrader, specifically engineered to identify trend shifts and potential entry points on a price chart. Rather than plotting a continuous line, it focuses on providing clear, distinct signals—represented as arrows—to help traders quickly recognize when momentum in the market is changing direction.

How the Logic Works

The core functionality of this tool relies on a specialized "filter" logic. Instead of looking at raw price action alone, it pulls data from a secondary underlying calculation (referred to as the BrainTrend1Stop). It analyzes two specific components of this data to determine when to place a signal:

1. Momentum Validation The script looks for specific transitions in the market's trend data. It doesn't just react to every minor price wiggle; it waits for a confirmed "break" or a "flip" in the underlying trend indicators. By comparing the current state of the trend against its previous state, the tool filters out "noise," ensuring that signals are only generated when a meaningful shift occurs.

2. Signal Generation (The Arrows) The indicator operates on two primary conditions to produce its visual outputs:

  • Red Signals: These appear when the data indicates a specific downward transition in trend momentum. The script checks if the current trend value exists while the previous one did not, triggering an alert for a potential bearish move.
  • Blue Signals: Conversely, these appear when the data signals an upward shift in momentum. By identifying where the trend "turns" from neutral or negative to positive, it highlights potential bullish opportunities.

Key Technical Behaviors

  • Historical Analysis: The script is capable of scanning back through a significant amount of historical price data (up to 5,000 bars), allowing you to see how the signals performed in past market conditions.
  • Clean Visuals: Because it uses "Arrows" rather than continuous lines, the chart remains uncluttered. This allows traders to see the current price action clearly while having specific points of reference for where a trend change was detected.
  • Dynamic Filtering: The logic is designed to be reactive. It constantly compares "Position A" (the present) with "Position B" (the immediate past). A signal is only plotted when there is a discrepancy between the two, which helps in identifying the exact moment a trend loses its previous strength and gains new direction.

Summary for the Trader

In plain terms, this tool acts as an early-warning system. It monitors the "health" of a market trend and places an arrow on your chart the moment it detects that the momentum has shifted significantly enough to warrant attention. This allows you to focus on high-probability trend changes rather than trying to predict every small movement in the price.

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

//+-----------------------------------------------------------------------+
//|                                                       BrainTrend1.mq4 |
//|                                   Copyright © 2005. Alejandro Galindo |
//|                                                   http://elCactus.com |
//|         ASCTrend1 modified to generate similar signals to BrainTrend1 |
//|           	Author := C0Rpus - big thanks CHANGE2002, STEPAN and SERSH |
//|	                                 Notes := ASCTrend1 3.0 Open Source |
//+-----------------------------------------------------------------------+

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

//---- input parameters
extern int RISK=3;
extern int CountBars=5000;

//---- buffers
double Buffer1[];
double Buffer2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW,0,1);
   SetIndexStyle(1,DRAW_ARROW,0,1);
   SetIndexBuffer(0,Buffer1);
   SetIndexBuffer(1,Buffer2);
   SetIndexArrow(0,108);
   SetIndexArrow(1,108);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| ASCTrend1                                                  |
//+------------------------------------------------------------------+
int start()
  {   
   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 BT1=0, BT2=0, BT3=0, BT4=0;
   if (CountBars>=Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars+11+1);
   SetIndexDrawBegin(1,Bars-CountBars+11+1);
  
//---- initial zero
//----
   shift=CountBars-11-1;
   while(shift>=0)
     {
         Buffer1[shift]=0;           
         Buffer2[shift]=0;
         BT1=iCustom(NULL,0,"BrainTrend1Stop",10,0,shift);
         BT2=iCustom(NULL,0,"BrainTrend1Stop",10,0,shift+1);      
         BT3=iCustom(NULL,0,"BrainTrend1Stop",10,1,shift);
         BT4=iCustom(NULL,0,"BrainTrend1Stop",10,1,shift+1);                     
         if (BT1 && !BT2) { Buffer2[shift]=BT1; }
         if (BT3 && !BT4) { Buffer1[shift]=BT3; }
         
      shift--;
     }

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


Comments