Errors, bugs, questions - page 2032

 
Money_Man:
Please tell me what I am doing wrong:

this code runs on EURUSD 30m



terminal gives an error:
2017.10.11 14:35:23.352 11111111111111111111111111 (EURUSD,M30) cannot load indicator 'Moving Average' [4302]



What a "complicated" issue. From the documentation - 4302:The symbol is not selected in MarketWatch.

You have to select AAPL in Market Watch.

 
Vladimir Karputov:

And so:

?


This will certainly work, the point is to replace Symbol() with a custom symbol (e.g. : "AAPL") that is different from the current graph

 
Stanislav Korotky:

What a "complicated" question, however. From the documentation - 4302:Symbol not selected in MarketWatch.

You need to select AAPL in market overview.


this is the first thing I checked, the symbol is forcibly added and when you run this code all symbols are added to the market overview

 
Money_Man:

This will certainly work, but the point is to replace Symbol() with your own symbol (e.g. : "AAPL") which is different from the current graph


Before giving a foreign symbol (different from the native one), first check the name of this foreign symbol with SymbolSelect.

 
Slava:
What does error 4302 mean?

ERR_MARKET_NOT_SELECTED

4302

Symbol is not selected in MarketWatch


But it is selected, I checked.

maybe the problem is that there are more candlesticks in the EUR hourly chart than in AAPL?

 
Money_Man:

ERR_MARKET_NOT_SELECTED

4302

Symbol is not selected in MarketWatch


But it is selected, I checked.

maybe the problem is that there are more candlesticks in the EUR hourly than in AAPL?


Show me:

  1. MQL5 code
  2. Login
  3. Trading server name
  4. INVESTOR password to the trading account.

 
Slava:

In five it will work

And there is a solution for your case in Quaternary

Call MQLSetInteger(MQL_CODEPAGE,CP_ACP) in OnInit;

Then the string conversions "back and forth" will be adequate.

Works in MT5 without any problems.

Thank you!

 
Vladimir Karputov:

Show me:

  1. MQL5 code
  2. Login
  3. Trading server name
  4. INVESTOR password to the trading account.


#property indicator_chart_window
#property indicator_buffers 0
#property indicator_plots   0
ENUM_MA_METHOD     MA_Type   = MODE_SMA;
ENUM_APPLIED_PRICE MA_Price  = PRICE_CLOSE;
int handle;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
{
   SymbolSelect("AAPL",true);
   handle = iMA("AAPL",_Period, 10,0,MA_Type,MA_Price);

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

   return(rates_total);
}
//+------------------------------------------------------------------+


information in the form of a screenshot ok?

But, that's what I can not find where to get the password of the investor(

Files:
 
Money_Man:


Is the information in the form of a screenshot OK?



There is no AAPL in the screenshot. And you don't check the SymbolSelect return code.

 
Money_Man:


will the information in the form of a screenshot work?

I can't find where to get investor password(

Go to your MT->Server->Change settings and use your username and password to create your investor password
Reason: