partendo da questa base ho bisogno di creare un EA che apra posizioni utilizzando 4 versioni dello stesso indicatore iCustom settato su diversi timeframes
//------------------------------------------------------------------
#property copyright "copyleft mladen"
#property link      "mladenfx@gmail.com"
//------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 0
#property strict

//
//
//
//
//

#define _disBar 1
#define _disLin 2
#define _disZer 4
enum enDisplayType
{
   dis_01=_disLin,                // Display bb stops line
   dis_02=_disBar,                // Display bb stops bars
   dis_03=_disZer,                // Display bb stops "zero" line
   dis_04=_disLin+_disBar,        // Display bb stops line and bars
   dis_05=_disLin+_disZer,        // Display bb stops line and "zero" line
   dis_06=_disBar+_disZer,        // Display bb stops bars and "zero" line
   dis_07=_disLin+_disBar+_disZer // Display all
};
enum enPrices
{
   pr_close,      // Close
   pr_open,       // Open
   pr_high,       // High
   pr_low,        // Low
   pr_median,     // Median
   pr_typical,    // Typical
   pr_weighted,   // Weighted
   pr_average,    // Average (high+low+open+close)/4
   pr_medianb,    // Average median body (open+close)/2
   pr_tbiased,    // Trend biased price
   pr_tbiased2,   // Trend biased (extreme) price
   pr_haclose,    // Heiken ashi close
   pr_haopen ,    // Heiken ashi open
   pr_hahigh,     // Heiken ashi high
   pr_halow,      // Heiken ashi low
   pr_hamedian,   // Heiken ashi median
   pr_hatypical,  // Heiken ashi typical
   pr_haweighted, // Heiken ashi weighted
   pr_haaverage,  // Heiken ashi average
   pr_hamedianb,  // Heiken ashi median body
   pr_hatbiased,  // Heiken ashi trend biased price
   pr_hatbiased2  // Heiken ashi trend biased (extreme) price
};
enum enMaTypes
{
   ma_sma,    // Simple moving average
   ma_ema,    // Exponential moving average
   ma_smma,   // Smoothed MA
   ma_lwma,   // Linear weighted MA
   ma_tema    // Triple exponential moving average - TEMA
};

extern ENUM_TIMEFRAMES TimeFrame       = PERIOD_CURRENT;  // Time frame
extern int             BandsPeriod     = 20;              // Bands period
extern double          BandsDeviation  = 1;               // Bands deviation
extern bool            BandsDeviationSample = false;      // Bands deviation with sample correction?
extern double          BandsRisk       = 1;               // Bands risk
extern enMaTypes       BandsMaType     = ma_sma;          // Bands average type
extern enPrices        Price           = pr_close;        // Price
extern bool            alertsOn        = false;           // Turn alerts on?
extern bool            alertsOnCurrent = false;           // Alerts on still opened bar?
extern bool            alertsMessage   = true;            // Alerts should display message?
extern bool            alertsSound     = false;           // Alerts should play a sound?
extern bool            alertsNotify    = false;           // Alerts should send a notification?
extern bool            alertsEmail     = false;           // Alerts should send an email?
extern string          soundFile       = "alert2.wav";    // Sound file
extern enDisplayType   DisplayWhat     = _disLin+_disBar; // Display type
extern color           ColorUp         = clrLimeGreen;    // Color for up
extern color           ColorDn         = clrOrangeRed;    // Color for down
extern color           ColorNe         = clrDarkGray;     // Color for neutral and "zero" line
extern bool            Interpolate     = true;            // Interpolate in multi time frame mode?

#define _iCustomCall(_buff,_y) iCustom(NULL,TimeFrame,"BB stops (new format) 1.3",PERIOD_CURRENT,BandsPeriod,BandsDeviation,BandsDeviationSample,BandsRisk,BandsMaType,Price,alertsOn,alertsOnCurrent,alertsMessage,alertsSound,alertsNotify,alertsEmail,soundFile,_buff,_y)

//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//

int OnInit() { return(INIT_SUCCEEDED);}  
void OnDeinit(const int reason) { }
int OnCalculate (const int       rates_total,
                 const int       prev_calculated,
                 const datetime& btime[],
                 const double&   open[],
                 const double&   high[],
                 const double&   low[],
                 const double&   close[],
                 const long&     tick_volume[],
                 const long&     volume[],
                 const int&      spread[] )
{
   double result = _iCustomCall(11,0);
      Comment("Current trend buffer content is : "+(string)result);
   return(rates_total);
}