Aiuto per aggiornare a MetaTrader 5 senza perdite - pagina 12

 
vdv2001:

Un po' di vernice sui livelli di Murray

Ho scaricato questo indicatore. Ho ricevuto un errore sulla linea 228 durante la compilazione. Non sono stato in grado di disegnarlo, quindi per favore prendetemi in parola. Voglio usare l'indicatore che uso su MT5, ecco perché sono qui, non potevo farlo da solo. Forse puoi riscriverlo per me. Non posso scriverlo io, grazie.
File:
 

Buon pomeriggio. I ragazzi intelligenti hanno davvero bisogno di tradurre l'indicatore di correlazione in MT5

File:
iCorel_v3.mq4  11 kb
 
È anche una buona e utile. È un bene per tutti.
File:
 
Perché le linee non sono tracciate?


#proprietà indicator_chart_window
#proprietà indicator_buffers 2
#proprietà indicator_plots 2
#property indicator_color1 clrDeepSkyBlue
#property indicator_color2 clrDeepSkyBlue
#proprietà indicator_chart_window
doppio UpBuffer[];
doppio DnBuffer[];
int OnInit()
{
SetIndexBuffer(0,UpBuffer);
SetIndexBuffer(1,DnBuffer);
PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_LINE); PlotIndexSetInteger(0,PLOT_DRAW_TYPE,PLOT_LINE_WIDTH,3); PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_LINE);
PlotIndexSetInteger(1,PLOT_DRAW_TYPE,DRAW_LINE); PlotIndexSetInteger(1,PLOT_DRAW_TYPE,PLOT_LINE_WIDTH,3);PlotIndexSetInteger(1,PLOT_DRAW_TYPE,DRAW_LINE);
ritorno(0);
}
//+------------------------------------------------------------------+
//| funzione di iterazione dell'indicatore personalizzata
//+------------------------------------------------------------------+
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;
for(i=1000;i>0;i--)
{ UpBuffer[i]=1.428; DnBuffer[i]=1.41;
}
ritorno(0);
}
Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
Документация по MQL5: Основы языка / Препроцессор / Свойства программ (#property)
  • www.mql5.com
Основы языка / Препроцессор / Свойства программ (#property) - Документация по MQL5
 
fellow:
Perché le linee non sono tracciate?



Dovrebbe essere qualcosa del genere, che ci crediate o no, funziona.

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_plots 2
#property indicator_color1 clrDeepSkyBlue
#property indicator_color2 clrDeepSkyBlue

double UpBuffer[];
double DnBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,UpBuffer);
   SetIndexBuffer(1,DnBuffer);

   PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(0,PLOT_DRAW_TYPE,PLOT_LINE_WIDTH,3);

   PlotIndexSetInteger(1,PLOT_DRAW_TYPE,DRAW_LINE);
   PlotIndexSetInteger(1,PLOT_DRAW_TYPE,PLOT_LINE_WIDTH,3);

//---
   return(0);
  }
//+------------------------------------------------------------------+
//| 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[])
  {
//---
   for(int i=rates_total-1000;i<rates_total;i++)
     {
      UpBuffer[i]=1.428;
      DnBuffer[i]=1.41;
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
 
voinG:
Scaricato questo indicatore. Durante la compilazione ha dato un errore alla linea 228, non ho potuto fare un'immagine, quindi per favore prendetemi in parola. Voglio usare l'indicatore che uso su MT5, ecco perché sono qui, non potevo farlo da solo. Forse puoi riscriverlo per me. Grazie.
L'azione di salvataggio è completa? Tutto quello che puoi dirmi.
 

Per favore, aiutatemi.

Ho provato a riscrivere WATL, ci sono quasi riuscito. Le linee non sono disegnate correttamente, è a causa di un calcolo LWMA storto. E soprattutto, a volte il grafico ha delle sorprese:

Sorpresa

Una linea di punti è talvolta identica ai punti su cui viene calcolato il WATL.

O a volte il grafico è ruotato e tutti i punti sono duplicati sulla barra adiacente.

Grazie in anticipo per qualsiasi aiuto =)

File:
WATL.mq5  41 kb
 

Forse chi ha visto questo indicatore nelle trasformazioni MQL5? http://www.kimiv.ru/index.php?option=com_remository&amp;Itemid=13&func=fileinfo&id=67

Автоматизация торговли на финансовых рынках - Скачать i-Spread3.rar
  • www.kimiv.ru
Оглавление файлового архива  Разработки на MQL4 Индикаторы   Очень хорошую доработку индикатора i-Spread предложил пользователь pavik. Суть доработки в добавлении отображения минимальных значений спрэда за последние час, четыре часа и сутки. А также...
 
Aiuto per convertire in mq5. Senza di loro, è come non avere mani!
 

Salve,

Non potevo fare quello che volevo.

Ho una coppia diversa da quella che avevo in testa.

[codice]
#proprietà indicator_separate_window
#proprietà indicator_buffers 6
#proprietà indicator_plots 2
#proprietà indicator_type1 DRAW_COLOR_LINE
#proprietà indicator_type2 DRAW_COLOR_LINE
#proprietà indicator_color1 clrBlue
#proprietà indicator_color2 clrRed
#proprietà indicator_style1 STYLE_SOLID
#proprietà indicator_style2 STYLE_SOLID

input int period_1 = 20;
input int period_2 = 100;
input ENUM_MA_METHOD ma_method = MODE_SMA;
input ENUM_APPLIED_PRICE applied_price = PRICE_CLOSE;

doppio ExtMapBuffer1[];
doppio ExtMapBuffer2[];
int EMHandle1=0;
int EMHandle2=0;
int EMHandle11=0;
int EMHandle22=0;
MqlParam params[]; // Struttura per salvare i parametri dell'indicatore
doppio ma1[],ma2[],ma3[],ma4[];//bubber temporali

int OnInit()
{
//--- mappatura dei buffer degli indicatori
SetIndexBuffer(0, ExtMapBuffer1, INDICATOR_DATA);
SetIndexBuffer(1, ExtMapBuffer2, INDICATOR_DATA);
SetIndexBuffer(2, ma1, INDICATOR_DATA);
SetIndexBuffer(3, ma2, INDICATOR_DATA);
SetIndexBuffer(4, ma3, INDICATOR_DATA);
SetIndexBuffer(5, ma4, INDICATOR_DATA);

PlotIndexSetInteger(0, PLOT_SHIFT, 0);
PlotIndexSetInteger(1, PLOT_SHIFT, 0);

PlotIndexSetInteger(0,PLOT_LINE_STYLE,STYLE_SOLID);
PlotIndexSetInteger(1,PLOT_LINE_STYLE,STYLE_SOLID);
//---
PlotIndexSetInteger(0,PLOT_LINE_COLOR,clrBlue);
PlotIndexSetInteger(1,PLOT_LINE_COLOR,clrRed);

PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_LINE);
PlotIndexSetInteger(1,PLOT_DRAW_TYPE,DRAW_LINE);
IndicatorSetString(INDICATOR_SHORTNAME, "2_2_MA");
//--- impostare la precisione
IndicatorSetInteger(INDICATOR_DIGITS,4);
//---
ArrayResize(params,4);
params[0].type =TYPE_INT;
params[0].integer_value=periodo_1;
// Offset
params[1].type =TYPE_INT;
params[1].integer_value=0;
// Metodo di calcolo: media semplice
params[2].type =TYPE_INT;
params[2].integer_value=MODE_SMA;
// tipo di prezzi per il calcolo: prezzi di chiusura
params[3].type =TYPE_INT;
params[3].integer_value=PRICE_CLOSE;

EMHandle1 = IndicatorCreate(_Symbol, 0, IND_MA, 4, params;)
ArrayResize(params,4);
params[0].type =TYPE_INT;
params[0].integer_value=periodo_2;
params[1].type =TYPE_INT;
params[1].integer_value=0;
params[2].type =TYPE_INT;
params[2].integer_value=MODE_SMA;
params[3].type =TYPE_INT;
params[3].integer_value=PRICE_CLOSE;

EMHandle2 = IndicatorCreate(_Symbol, 0, IND_MA, 4, params;)
ArrayResize(params,4);
params[0].type =TYPE_INT;
params[0].integer_value=periodo_1;
params[1].type =TYPE_INT;
params[1].integer_value=0;
params[2].type =TYPE_INT;
params[2].integer_value=MODE_SMA;
params[3].type =TYPE_INT;
params[3].integer_value=PRICE_CLOSE;

EMHandle11 = IndicatorCreate(_Symbol, 0, IND_MA, 4, params;)
ArrayResize(params,4);
params[0].type =TYPE_INT;
params[0].integer_value=periodo_2;
params[1].type =TYPE_INT;
params[1].integer_value=0;
params[2].type =TYPE_INT;
params[2].integer_value=MODE_SMA;
params[3].type =TYPE_INT;
params[3].integer_value=PRICE_CLOSE;

EMHandle22 = IndicatorCreate(_Symbol, 0, IND_MA, 4, params;)

ritorno(0);
}
int OnCalculate (const int rates_total,// dimensione dell'array price[];
const int prev_calculated,// numero di barre disponibili ;sulla chiamata precedente;
const int begin,// quale indice nell'array price[] inizierà i dati validi;
const double &price[]) // array su cui verrà calcolato l'indicatore;
{
int i;
ArraySetAsSeries(ma1, true);
ArraySetAsSeries(ma2, true);
ArraySetAsSeries(ma3, true);
ArraySetAsSeries(ma4, true);

if(CopyBuffer(EMHandle1, 0, 0, 1, ma1) < 0){Print("CopyBuffer ma1 error =", GetLastError());}
if(CopyBuffer(EMHandle2, 0, 0, 1, ma2) < 0){Print("CopyBuffer ma2 error =", GetLastError());}
if(CopyBuffer(EMHandle11, 0, 0, 1, ma3) < 0){Print("CopyBuffer ma3 error =", GetLastError());}
if(CopyBuffer(EMHandle22, 0, 0, 0, 1, ma4) < 0){Print("CopyBuffer ma4 error =", GetLastError());}
limite int;
//if(prev_calculato<1)
//limit=periodo_1;
limit=prev_calculated-1;
for( i=0; i<limit; i++)
ExtMapBuffer1[0]=calcolato;
ExtMapBuffer2[0]=calcola;

Commento(
"\n=====================",
"\n ma1[0] : ",DoubleToString(ma1[0],5),
"\n ma2[0] : ",DoubleToString(ma2[0],5),
"\n ma3[0] : ",DoubleToString(ma3[0],5),
"\n ma4[0] : ",DoubleToString(ma4[0],5),
"\n ExtMapBuffer1[0] : ",DoubleToString(ExtMapBuffer1[0],4),
"\n ExtMapBuffer2[0] : ",DoubleToString(ExtMapBuffer2[0],4)
);
return(rates_total);
}
void OnDeinit(const int reason)
{
Commento(");
}
[/code]

Quando 0 invece di i (per una barra) vedo il risultato, quando la barra (corrente = i) mostra che non posso trovare dati per la seconda coppia.

Il grafico della coppia è aperto, nella finestra del mercato non so dove confondo le cose.

Due coppie diverse in un indicatore - quindi dov'è il mio errore?

Provo a mettere 0 e vedo il risultato come commento, ma non ho una linea.

Per chiarire: ho messo ma1 e ma2 su una coppia e ma3 e ma4 sull'altra coppia.

Grazie.

Motivazione: