XO_ALERT_cci_cross_v1

Download script
Author: Kalenzo
XO_ALERT_cci_cross_v1

This tool is designed to monitor market trends across multiple timeframes simultaneously to identify high-probability trading entries. By analyzing data from several different perspectives, it filters out "noise" and ensures that a signal is only generated when there is a consistent alignment between short-term and long-term price movements.

Multi-Timeframe Analysis

The core logic of the script relies on gathering information from four specific timeframes: 60 minutes, 30 minutes, 15 minutes, and 5 minutes. It looks for specific "Open" signals provided by a secondary technical indicator across all four of these periods.

Signal Detection Logic

The script evaluates two primary conditions to determine the market direction:

  • Bullish Trend (Long): The tool looks for a situation where the current green trend signals are active across all four timeframes, while at least one of the previous signals has recently cleared or transitioned. This confirms that a bullish momentum is currently establishing itself.
  • Bearish Trend (Short): Conversely, if the red trend signals become active across all four timeframes while previous signals have cleared, the tool identifies a bearish momentum.

Execution and Confirmation

Once the multi-timeframe trend is established, the script does not immediately trigger an action based on that information alone. Instead, it waits for a secondary confirmation using a momentum oscillator (CCI).

  1. Trend Establishment: The script first identifies if the overall market bias is positive or negative based on the multi-timeframe scan.
  2. Momentum Confirmation: Once a bias is set, the tool monitors the CCI values. A "Long" alert is triggered only if the momentum shifts from negative to positive. A "Short" alert is triggered only if the momentum shifts from positive to negative.

Summary of Operation

In simple terms, this script acts as a filter. It ensures that you are only notified of a trade when the 5, 15, 30, and 60-minute charts all agree on the direction of the market, and then waits for a specific momentum "flip" to provide the final confirmation for entry. This dual-layer verification is intended to keep traders aligned with the broader market flow while capturing precise entry points.

Indicators Used
Commodity channel index
Miscellaneous
It issuies visual alerts to the screen
14 Views
0 Downloads
0 Favorites
XO_ALERT_cci_cross_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                    XO_EA_FTP.mq4 |
//|                                                          Kalenzo |
//|                                      bartlomiej.gorski@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Kalenzo"
#property link      "bartlomiej.gorski@gmail.com"
#property indicator_chart_window

extern int barToCheck = 1;
extern int cci = 34;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
  
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
  
  
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start(){
   static int dir = 0;
   static int mode = 0;

//----
   
   
   if(Bars>mode){
      double xo60g = iCustom(Symbol(),0,"ZZ  MTF  XO  A",60,5,0,barToCheck);//green 60
      double xo60r = iCustom(Symbol(),0,"ZZ  MTF  XO  A",60,5,1,barToCheck);//red 60

      double xo30g = iCustom(Symbol(),0,"ZZ  MTF  XO  A",30,6,0,barToCheck);//green 30
      double xo30r = iCustom(Symbol(),0,"ZZ  MTF  XO  A",30,6,1,barToCheck);//red 30

      double xo15g = iCustom(Symbol(),0,"ZZ  MTF  XO  A",15,5,0,barToCheck);//green 15
      double xo15r = iCustom(Symbol(),0,"ZZ  MTF  XO  A",15,5,1,barToCheck);//red 15

      double xo5g = iCustom(Symbol(),0,"ZZ  MTF  XO  A",5,5,0,barToCheck);//green 5
      double xo5r = iCustom(Symbol(),0,"ZZ  MTF  XO  A",5,5,1,barToCheck);//red 5

      double pxo60g = iCustom(Symbol(),0,"ZZ  MTF  XO  A",60,5,0,barToCheck+1);//green 60
      double pxo60r = iCustom(Symbol(),0,"ZZ  MTF  XO  A",60,5,1,barToCheck+1);//red 60

      double pxo30g = iCustom(Symbol(),0,"ZZ  MTF  XO  A",30,6,0,barToCheck+1);//green 30
      double pxo30r = iCustom(Symbol(),0,"ZZ  MTF  XO  A",30,6,1,barToCheck+1);//red 30

      double pxo15g = iCustom(Symbol(),0,"ZZ  MTF  XO  A",15,5,0,barToCheck+1);//green 15
      double pxo15r = iCustom(Symbol(),0,"ZZ  MTF  XO  A",15,5,1,barToCheck+1);//red 15

      double pxo5g = iCustom(Symbol(),0,"ZZ  MTF  XO  A",5,5,0,barToCheck+1);//green 5
      double pxo5r = iCustom(Symbol(),0,"ZZ  MTF  XO  A",5,5,1,barToCheck+1);//red 5

   
    
   
      //green open signal
      if(xo60g != 0 && xo30g != 0 && xo15g != 0 && xo5g != 0 && (pxo60g == 0 || pxo30g == 0 || pxo15g == 0 || pxo5g == 0) ){
         //Alert(Symbol()+" "+Period()+" XO Long ",Bid); 
         mode = Bars;
         dir = 1;
         }//red open signal
      else if(xo60r != 0 && xo30r != 0 && xo15r != 0 && xo5r != 0 && (pxo60r == 0 || pxo30r == 0 || pxo15r == 0 || pxo5r == 0) ){
         //Alert(Symbol()+" "+Period()+" XO Short ",Bid); 
         mode = Bars;
         dir = -1;
         }
      }   
   if(dir!=0){
      static int ltime = 0;
      if(ltime!=Bars){
         double cci0 = iCCI(NULL,0,cci,PRICE_CLOSE,barToCheck);
         double cci1 = iCCI(NULL,0,cci,PRICE_CLOSE,barToCheck+1);
         if(dir==1 && cci0>0 && cci1<0){
            ltime=Bars;
            Alert(Symbol()+" "+Period()+" XO Long ",Bid); 
            }
         else if(dir==-1 && cci0<0 && cci1>0){
            ltime=Bars;
            Alert(Symbol()+" "+Period()+" XO Short ",Bid); 
            } 
         }
      }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments