ROBOT RADING WITH CCI(20)

 

Hi,

I am looking for a code to automate instant execution bid request for long and short positions. The input trigger is the position of the 5 minute chart CCI (20). With the crossing at -30 and standard deviation of -50 for short and +30 for long positions and a standard deviation of +50.

Also, to be included is stop loss and take profit of 50 pips, 0.1 lot size per bid.

Kindly assist

Bonn Oluoch


BELOW IS WORK DONE SO FAR

//--- input parameters
input double   Lots=0.1;
extern double   tp=50.0;
extern double   sl=50.0;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create timer
   EventSetTimer(60);

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   EventKillTimer();

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

  }
//+------------------------------------------------------------------+
//| Timer function                                                   |
//+------------------------------------------------------------------+
void OnTimer()
  {
//---

  }
//+------------------------------------------------------------------+
//| Tester function                                                  |
//+------------------------------------------------------------------+
double OnTester()
  {
//---
   double ret=0.0;
//---

//---
   return(ret);
  }
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam)
  {
//---

  }
//+------------------------------------------------------------------+

Reason: