GordagoElder-generated

Author: RT
GordagoElder-generated

This automated trading script is designed to identify high-probability market entries by analyzing price action across three different timeframes simultaneously. By combining these perspectives, the logic aims to ensure that every trade aligns with the overarching market direction while seeking the most advantageous moment to enter.

The strategy operates using a "three-screen" approach:

1. The Long-Term Trend (Hourly View) First, the script examines the 1-hour chart to determine the broader market direction. It looks for specific momentum signals using the MACD indicator. Specifically, it seeks instances where the histogram is moving upward, with a particular preference for entries that occur when this momentum turns upward from below the zero line. This step ensures the system is only trading in the direction of the primary trend.

2. The Intermediate Correction (15-Minute View) Once the long-term trend is established, the script shifts its focus to the 15-minute timeframe to identify a "recoil" or pullback. Instead of buying immediately when the price is high, the logic waits for a brief dip—a moment where the price temporarily lowers despite the overall upward trend. It uses the Stochastic Oscillator to detect these opportunities, specifically looking for when the indicator falls into an "oversold" zone and begins to turn back upward. This allows the system to enter a trade at a more favorable, cheaper price.

3. The Precise Entry (1-Minute View) Finally, the script narrows its focus to the 1-minute timeframe to find the exact moment for execution. It looks for a "sliding signal" triggered by actual price movement. For a buy order, it confirms that the current price has risen above the high of the previous candle. This final check acts as a confirmation trigger, ensuring that the market is actively moving in the desired direction before the trade is finalized.

Safety and Requirements Before the logic begins, the script performs several safety checks to protect the account. It verifies that there is enough historical data available, ensures that the specified Stop Loss values are within acceptable limits, and confirms that the account has sufficient free margin to cover the requested trade size.

12 Views
0 Downloads
0 Favorites
GordagoElder-generated
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                       GordagoElder-generated.mq4 |
//|                                                               RT |
//|                       http://www.gordago.com/?act=strategy&num=1 |
//+------------------------------------------------------------------+
#property copyright "RT"
#property link      "http://www.gordago.com/?act=strategy&num=1"

// User input
extern double    lStopLoss=17.0;
extern double    sStopLoss=46.0;
extern double    lTrailingStop=18.0;
extern double    sTrailingStop=22.0;
extern double    Lots=0.1;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
   int cnt, ticket;

   if(Bars<100)                        {Print("bars less than 100");     return(0);}
   if(lStopLoss<10)                    {Print("StopLoss less than 10");  return(0);}
   if(sStopLoss<10)                    {Print("StopLoss less than 10");  return(0);}
   if(AccountFreeMargin()<(1000*Lots)) {Print("We have no Free Margin"); return(0);}

   
   // 1) H1 timeframe (1 hour)
   // At this stage necessary to reveal the long-term trend. 
   // For this use checking the following conditions: 
   //
   // The MACD histogram moves upwards. Moreover signal will be the most 
   // strong if this Forex indicator turned round upwards being below its zero line.
   
   double diMACD0=iMACD(Symbol(),60,13,30,0,PRICE_CLOSE,MODE_MAIN,0);
   double diMACD1=iMACD(Symbol(),60,13,30,0,PRICE_CLOSE,MODE_MAIN,1);

   // 2) M15 timeframe (15 minutes).
   // For profitable buy, it is necessary not only to buy toward trend. 
   // It is necessary to buy on recoil, when under the total trend to 
   // increasing on the market was formed small recoil - a price little 
   // was lowered, and there is possibility to buy more cheaply. 
   // We shall use the indicator Stohastik:
   // 
   // Stohastik is found below oversell level but herewith has turned upstairs.

   double diStochastic5=iStochastic(Symbol(),15,2,0,3,MODE_EMA,PRICE_CLOSE,MODE_MAIN,0);
   double diStochastic6=iStochastic(Symbol(),15,2,0,3,MODE_EMA,PRICE_CLOSE,MODE_MAIN,1);

   // 3) M1 timeframe (1 minute)
   // On Elder's trade tactic third screen is used for optimum entry in deal. 
   // It is necessary to set the sliding signal on buying, when price will 
   // rise above high of the previous candle.

   double diClose7=iClose(Symbol(),1,0);
   double diHigh8=iHigh(Symbol(),1,1);



   double diMACD2=iMACD(NULL,60,13,30,0,PRICE_CLOSE,MODE_MAIN,1);
   double diStochastic3=iStochastic(NULL,15,2,0,3,MODE_EMA,PRICE_CLOSE,MODE_MAIN,0);
   double d4=(36);
   double diMACD9=iMACD(NULL,60,14,56,0,PRICE_CLOSE,MODE_MAIN,0);
   double diMACD10=iMACD(NULL,60,14,56,0,PRICE_CLOSE,MODE_MAIN,1);
   double diMACD11=iMACD(NULL,60,14,56,0,PRICE_CLOSE,MODE_MAIN,1);
   double diStochastic12=iStochastic(NULL,15,1,0,3,MODE_EMA,PRICE_CLOSE,MODE_MAIN,0);
   double d13=(66);
   double diStochastic14=iStochastic(NULL,15,1,0,3,MODE_EMA,PRICE_CLOSE,MODE_MAIN,0);
   double diStochastic15=iStochastic(NULL,15,1,0,3,MODE_EMA,PRICE_CLOSE,MODE_MAIN,1);
   double diClose16=iClose(NULL,1,0);
   double diLow17=iLow(NULL,1,1);

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

Comments