a_Nina

This script functions as a visual trading assistant designed to identify specific market signals on your chart. Rather than drawing continuous lines, it acts as a scanner that marks high-probability entry points using distinct symbols (arrows), making it easier for traders to spot trend shifts at a glance.

Core Logic and Functionality

The tool operates by processing historical price data across a multi-timeframe perspective. Here is a breakdown of how it handles the information:

1. Multi-Timeframe Analysis One of the key strengths of this script is its ability to look "deeper" into the market than what is immediately visible on your current chart. It pulls data from a specific timeframe (defaulted to 30 minutes) to ensure that the signals generated are based on broader market movements rather than just minor, insignificant price flickers.

2. Data Filtering and Synchronization The script performs a "shift" calculation. This means it aligns the data from the larger timeframe with the smaller timeframe you are currently viewing. By doing this, it ensures that the signals appear accurately in time, preventing the tool from showing outdated or mismatched information. It essentially synchronizes two different views of the market into one single visual display.

3. Signal Generation The logic relies on an external mathematical model (referred to as "aNina") to calculate trends. The script monitors this model for two specific types of outputs:

  • Buy Signals: When the underlying logic detects a bullish condition, the script places a blue arrow slightly below the current price candle.
  • Sell Signals: When the logic detects a bearish condition, the script places a red arrow slightly above the current price candle.

4. Visual Cleanup and Optimization To keep your chart clean and readable, the script includes built-in logic to prevent "clustering." It checks for redundant data points; if it detects that a signal is being repeated unnecessarily on the same bar, it suppresses the duplicate. This ensures that you only see clear, actionable signals without visual clutter.

Summary for the User

In simple terms, this tool acts as an automated analyst. It looks at 30-minute trends, calculates whether the market is leaning bullish or bearish based on a specific set of rules, and then places a blue "Buy" or red "Sell" arrow on your chart to notify you of these opportunities in real-time.

Miscellaneous
Implements a curve of type %1
12 Views
0 Downloads
0 Favorites
a_Nina
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

//---- input parameters
extern int PeriodWATR=10;
extern double Kwatr=1.0000;
extern int HighLow=0;
extern int cbars = 1000;
extern int from  = 0;
extern int period  = PERIOD_M30;


//---- indicator buffers
double LineBuyBuffer[];
double LineSellBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init(){
   string short_name;
//---- indicator line
   SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,2);
   SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,2);
   
   SetIndexEmptyValue(0,0);
   SetIndexArrow(0,233);
   
   SetIndexEmptyValue(1,0);
   SetIndexArrow(1,234);
   SetIndexBuffer(0,LineBuyBuffer);
   SetIndexBuffer(1,LineSellBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name="NinaX";
   IndicatorShortName(short_name);

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

int start(){
   int i,b,f = iBarShift(NULL,period,Time[from]),l = 0;
   ArrayInitialize(LineBuyBuffer,0);
   ArrayInitialize(LineSellBuffer,0);
   
   for(i=cbars-1;i>=from;i--){	
      b = iBarShift(NULL,period,Time[i]);
      if(l==b){
         LineBuyBuffer[i]  = 0;
         LineSellBuffer[i] = 0;
         }
      else{
         l = b;
         LineBuyBuffer[i]  = iCustom(NULL,period,"aNina",PeriodWATR,Kwatr,HighLow,cbars,f,2,b);
         if(LineBuyBuffer[i]!=0) LineBuyBuffer[i] = Low[i]-10*Point;
         LineSellBuffer[i] = iCustom(NULL,period,"aNina",PeriodWATR,Kwatr,HighLow,cbars,f,3,b);
         if(LineSellBuffer[i]!=0) LineSellBuffer[i] = High[i]+10*Point;
         }
	   }
	return(0);	
 }

Comments