How to progame RSI Expert Advisor

 

Hi all,


I am newbie for MQL4.

I would like to program Exper Advisor with condition as follow:


1. If RSI(14) > 70 --> Sell

2. If RSI(14) < 30 --> Buy


Please help me.

Thanks

 
Nobody is going to post a fully working expert advisor with just these conditions. I can point you in the right direction which is to use the iRSI() function. You can find it in the documentation.
 

Just use this Universal Expert Advisor scheme and put your conditions here:

double Strategy_001(int COMMAND)
{
   string   _SYMBOL        = Symbol();
   int      _TIMEFRAME     = getStrategyTimeframeByNumber(_STRATEGY_TIMEFRAME);
         
   double   result         = 0;
   
   int      i;

   switch(COMMAND)
   {
      case _OPEN_LONG:
      {
//         break;

//         if(!OpenNewBar())
//            break;

         if(Open long condition is true)
            result = 1;

         break;
      }
      case _OPEN_SHORT:
      {
//         break;

//         if(!OpenNewBar())
//            break;

         if(Open short condition is true)
            result = 1;

         break;
      }
      case _CLOSE_LONG:
      {
//         break;

         if(Close long condition is true)
            result = 1;
            
            break;
      }
      case _CLOSE_SHORT:
      {
//         break;

         if(Close short condition is true)
            result = 1;

            break;
      }
 

Many thank


navodar



Reason: