Insert an indicator

MQL4 Scripts

Job finished

Execution time 4 days
Feedback from customer
Programmer, very professional and fast !!! Recommended!!!
Feedback from employee
Thanks for your order!

Specification

Hi, I would need to place an indicator inside of a variable or an array, bypassing the iCustom function (iCustom (NULL, PERIOD_CURRENT, "Laguerre", 0.7, 950, 0, i)> 0.2). I have a "Languerre" indicator that I would insert into a "Pippo" container. I attach a code to correct. I hope I was clear enough.

#property indicator_chart_window
#property indicator_buffers 2

#property indicator_type1 DRAW_ARROW
#property indicator_width1 1
#property indicator_color1 clrGreen
#property indicator_label1 "Buy"
extern double gamma = 0.7;
extern int CountBars = 950;
//----
double L0 = 0;
double L1 = 0;
double L2 = 0;
double L3 = 0;
double L0A = 0;
double L1A = 0;
double L2A = 0;
double L3A = 0;
double LRSI = 0;
double CU = 0;
double CD = 0;
//---- buffers
double val1[];
double pippo;
double Buffer1[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
IndicatorBuffers(1);
   SetIndexBuffer(0,Buffer1);
   SetIndexEmptyValue(0,0);
   SetIndexArrow(0,241);
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
  int i=0;
pippo = i=CountBars-1;
   while(i>=0)
   {
      L0A = L0;
      L1A = L1;
      L2A = L2;
      L3A = L3;
      L0 = (1 - gamma)*Close[i] + gamma*L0A;
      L1 = - gamma *L0 + L0A + gamma *L1A;
      L2 = - gamma *L1 + L1A + gamma *L2A;
      L3 = - gamma *L2 + L2A + gamma *L3A;

      CU = 0;
      CD = 0;
      
      if (L0 >= L1) CU = L0 - L1; else CD = L1 - L0;
      if (L1 >= L2) CU = CU + L1 - L2; else CD = CD + L2 - L1;
      if (L2 >= L3) CU = CU + L2 - L3; else CD = CD + L3 - L2;

      if (CU + CD != 0) LRSI = CU / (CU + CD);
      val1[i] = LRSI;
          i--;]
        }
        if (pippo[i]>0.2)
        {
        Buffer1[i]= High[i]+10*Point();
        
        }
        
       
   return(rates_total);
  }
//+------------------------------------------------------------------+
//iCustom(NULL, PERIOD_CURRENT, "Laguerre", 0.7, 950, 0, i) > 0

Files:

MQ4
Laguerre.mq4
2.8 Kb

Responded

1
Developer 1
Rating
(590)
Projects
789
71%
Arbitration
9
33% / 33%
Overdue
22
3%
Free
Published: 8 codes
2
Developer 2
Rating
(804)
Projects
1124
43%
Arbitration
47
49% / 23%
Overdue
84
7%
Free
Similar orders
Job Description: We are looking for an experienced MQL5 developer to create a script or Expert Advisor (EA) that automatically updates the price of a token CFD on MT5, using a live BTCUSD feed. The goal is to make token fully CFD-tradable , with real-time price updates, charts, and client P/L. Clients should be able to trade long or short and view live candles, just like other MT5 CFDs. Scope of Work / Requirements

Project information

Budget
10 USD
Deadline
from 1 to 5 day(s)