Questions from Beginners MQL5 MT5 MetaTrader 5 - page 276

 
aleks557:

hello beginner and advanced help solve a 5th grade maths problem:)

...
First of all, post the code you wrote here, make it buggy, we'll help. it now looks like "do this and that to me".
 
aleks557:
What am I doing wrong? Where's the code? I put it in.
There's something bugs in the forum today. Not everything is showing up as it should. Wait when they fix it.
 
paladin800:
There's something buggy about the forum today. Not everything is displaying as it should. Wait for them to fix it.

Code insertion check:

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit(void)
  {
//--- drawing settings
   SetIndexStyle(0,DRAW_NONE);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexStyle(2,DRAW_HISTOGRAM);
   IndicatorDigits(Digits+1);
   SetIndexDrawBegin(0,DATA_LIMIT);
   SetIndexDrawBegin(1,DATA_LIMIT);
   SetIndexDrawBegin(2,DATA_LIMIT);
 
//+------------------------------------------------------------------+
//|my first indicator.mq5 |
//| Copyright 2014, MetaQuotes Software Corp. ||
//|http://www.mql5.com |
//+------------------------------------------------------------------+
#property version "1.00"
#property indicator_chart_window
input string Symbol0 = "EURUSD";//1 symbol
input bool Trade0 = true; // on/off
input string Symb1 = "USDCHF";//2-symbol
input bool Trade1 = true; // on/off
input stringSymb2 = "USDJPY";//3 symbol
input boolTrade2 = true; // on/off
input stringSymb3 = "USDCAD";//4-symbol
input boolTrade3 = true; // on/off
input string Symb4 = "AUDUSD";//5-symbol
input bool Trade4 = true; // on/off
input string Symb5 = "AUDNZD";//6symbol
input bool Trade5 = true; // on/off
input stringSymb6 = "USDCAD";//4-symbol
input boolTrade6 = true; // on/off
input stringSymb7 = "AUDUSD";//5-symbol
input boolTrade7 = true; // on/off
input string Symb8 = "AUDNZD";/ /6-symbol
input bool Trade8 = true; //on/off
//+------------------------------------------------------------------+
//| Custom indicator initialization function|
//+------------------------------------------------------------------+
Symbol0= a;



//--- indicator buffers mapping

//---

//+------------------------------------------------------------------+
//| 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[])
{
//---

//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
 
//+------------------------------------------------------------------+
//|                                         мой первый индикатор.mq5 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property version   "1.00"
#property indicator_chart_window
input string            Symbol0 = "EURUSD";//1символ
input  bool            Trade0 = true; // вкл/выкл
input string            Symb1 = "USDCHF";//2символ
input  bool            Trade1 = true; // вкл/выкл
input string            Symb2 = "USDJPY";//3символ
input  bool            Trade2 = true; // вкл/выкл
input string            Symb3 = "USDCAD";//4символ
input  bool            Trade3 = true; // вкл/выкл
input string            Symb4 = "AUDUSD";//5символ
input  bool            Trade4 = true; // вкл/выкл
input string            Symb5 = "AUDNZD";//6символ
input  bool            Trade5 = true; // вкл/выкл
input string            Symb6 = "USDCAD";//4символ
input  bool            Trade6 = true; // вкл/выкл
input string            Symb7 = "AUDUSD";//5символ
input  bool            Trade7 = true; // вкл/выкл
input string            Symb8 = "AUDNZD";//6символ
input  bool            Trade8 = true; // вкл/выкл
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
 Symbol0= a;
 
 
  
//--- indicator buffers mapping
   
//---
 
//+------------------------------------------------------------------+
//| 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[])
  {
//---
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
 
aleks557:
well let me try again :.................................................... no guys not working ! i will try tomorrow !

which browser?

what version?

details to servicedesk

 
used the functions : insert text, pictures, tables, code, video !
 

question

какой браузер?

version of the software?

the answer is

used the function: paste text, pictures, tables, code, video !


no further questions.

You are welcome to keep complaining.

 
sergeev:

Question

the answer is


No more questions.

Feel free to keep complaining.

Who knows what version it is, ... the normal version is the one that was sold, and the browser with coloured buttons ! I'm doing a "Yandex" search in vain.

I keep my printer strict and my keyboard sacred, and if the mouse is tempted, I cut off my mouse!

I'll read Control+Alt+Delit:)))

I understand MQl5 reads line by line .Thanks for the first lesson!

 
//+------------------------------------------------------------------+
//|                                         мой первый индикатор.mq5 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property version   "1.00"
#property indicator_chart_window
input string            Symb0 = "EURUSD";//1символ
input  bool            Trade0 = true; // вкл/выкл
input string            Symb1 = "USDCHF";//2символ
input  bool            Trade1 = true; // вкл/выкл
input string            Symb2 = "USDJPY";//3символ
input  bool            Trade2 = true; // вкл/выкл
input string            Symb3 = "USDCAD";//4символ
input  bool            Trade3 = true; // вкл/выкл
input string            Symb4 = "AUDUSD";//5символ
input  bool            Trade4 = true; // вкл/выкл
input string            Symb5 = "AUDNZD";//6символ
input  bool            Trade5 = true; // вкл/выкл
input string            Symb6 = "USDCAD";//4символ
input  bool            Trade6 = true; // вкл/выкл
input string            Symb7 = "AUDUSD";//5символ
input  bool            Trade7 = true; // вкл/выкл
input string            Symb8 = "AUDNZD";//6символ
input  bool            Trade8 = true; // вкл/выкл
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
 Symbol0= a;
 
 
  
//--- indicator buffers mapping
   
//---
 
//+------------------------------------------------------------------+
//| 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[])
  {
//---
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
задачку поставил для себя . найти среднее арифметическое валют и вывести в линии индикатора для начала . а сегодня идея пришла : Данный график выводится 
и расчет нового значения  выполняется каждый раз при получении информации о 
сделке по инструменту, входящему его состав, по следующей формуле:
V = Vпред. + Wист. * (EMAист. - EMAист.пред.), где:
 V – новое значение символа;
 Vпред. – предыдущее значение символа (начальное значение = 0);
 Wист. – вес источника (влияние изменений данного инструмента на символ, может 
принимать отрицательные значения);
 EMAист. – текущее значение экспоненциальной средней цены инструмента;
 EMAист.пред. - предыдущее значение экспоненциальной средней цены инструмента.
Значение EMAист. рассчитывается по следующей формуле:
EMAист. = Wн.з. * Pист. / step + (1 - Wн.з.) * EMAпред., где:
 Wн.з. – вес нового значения при усреднении (когда Wн.з. = 1 усреднения не происходит);
 Pист. – цена в сделке по данному инструменту;
 step – шаг цены инструмент в 
общем формула заимствована  от торгового привода Qscalp поводырь
а пока не знаю как описать среднее арифметическое валют и вывести в линии индикатора  растолкуйте пожалуйста чайнику
Reason: