nd2Sig

This tool is designed as a visual trading aid for the MetaTrader platform, specifically created to identify potential market turning points by analyzing price trends. Instead of creating complex mathematical models from scratch, this script acts as a specialized "signal generator" that interprets data from an underlying trend analysis system to provide clear, actionable alerts on your chart.

How It Works

The core logic of the script relies on detecting specific shifts in momentum. It continuously monitors the relationship between current price movements and previous price action. Rather than drawing constant lines, it focuses on "trigger events."

To achieve this, the script looks for specific instances where a trend's underlying force changes direction. It compares the data from the current candle against the preceding candle to identify a definitive break in momentum. When the system detects that a previous trend has exhausted and a new movement is beginning, it places a visual marker on the chart.

Visual Signals

The script communicates with the trader using two distinct types of visual arrows:

  • Bullish Signals (Blue): These appear when the logic identifies a shift in momentum toward an upward movement. It marks a point where the downward pressure has weakened enough for a potential reversal or continuation to the upside.
  • Bearish Signals (Red): These appear when the script detects a shift toward downward momentum, indicating that the upward price action is losing strength and may be heading lower.

Key Features for the User

  • Clean Visuals: By using arrows rather than continuous lines, the chart remains uncluttered, allowing you to see only the most important signals while keeping your price action visible.
  • Historical Analysis: The tool is designed to scan a significant amount of historical data (up to 5,000 bars), allowing you to backtest the accuracy of the signals over various market conditions.
  • Trend Filtering: Because it is based on "BrainTrend" logic, the signals are intended to help filter out minor market noise, aiming to highlight more significant trend changes rather than every small price fluctuation.
Miscellaneous
Implements a curve of type %1
16 Views
0 Downloads
0 Favorites
nd2Sig
//+-----------------------------------------------------------------------+
//|                                                    BrainTrend2Sig.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,"BrainTrend2Stop",10,0,shift);
         BT2=iCustom(NULL,0,"BrainTrend2Stop",10,0,shift+1);      
         BT3=iCustom(NULL,0,"BrainTrend2Stop",10,1,shift);
         BT4=iCustom(NULL,0,"BrainTrend2Stop",10,1,shift+1);                     
         if (BT1 && !BT2) { Buffer2[shift]=BT1; }
         if (BT3 && !BT4) { Buffer1[shift]=BT3; }
         
      shift--;
     }

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


Comments