nd2Sig_v1

This tool is designed to function as a visual signal generator for traders who want to identify specific momentum shifts and trend reversals on a price chart. Rather than drawing continuous lines, it acts as an alert system that places markers (arrows) at precise moments when certain mathematical conditions are met.

Core Functionality

The script works by analyzing data from a secondary underlying calculation called "BrainTrend2Stop." It monitors the behavior of this trend data over a significant historical period (up to 5,000 bars) to ensure that the signals it provides are based on consistent market movement rather than temporary price noise.

How the Signals Are Generated

The logic focuses on "change detection." The tool looks for specific instances where the trend values jump or activate suddenly:

  • Trend Identification: The script compares the current state of the trend data against the previous state.
  • Signal Triggers:
    • When it detects a specific movement in one part of the trend calculation that wasn't present in the previous moment, it places a Blue marker.
    • When it detects a corresponding shift in another part of the calculation, it places a Red marker.
  • Visual Execution: These markers appear as arrows on your chart. By looking for these specific "jumps" in the underlying data, the script aims to highlight potential entry or exit points where the market momentum may be switching direction.

Key User Settings

To ensure the tool behaves exactly as needed, it includes a few adjustable parameters:

  • Risk Factor: A setting that allows you to influence the sensitivity of the calculation.
  • Count Bars: This determines how far back into the past the script looks to perform its analysis. It ensures that the tool has enough historical context to make accurate readings.

In summary, this script simplifies complex trend mathematics into a clean, visual format, providing traders with clear markers to help identify potential shifts in market direction.

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

//+-----------------------------------------------------------------------+
//|                                                    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