Questions from Beginners MQL5 MT5 MetaTrader 5 - page 356
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Karputov Vladimir:
Высылайте.
Sent
Send it to me.
With the help ofKarputov Vladimir. I have solved the problem by getting the indicator handle in the OnInit() function and then deleting it in OnDeinit().
Could you please make the indicator draw lines from a certain bar, not on the entire history?
Good afternoon. I have such a problem. I have started to learn MQL and am writing an EA. When I compile and then run my EA, it opens EURUSD one hour chart, but I have not specified which chart to open. I have prescribed the opening of Euro dollar for 5 minutes. First it opens Euro dollar by an hour, and then by 5 minutes. How can I delete the hour chart? Here is the code of the Expert Advisor. Thanks for the advice in advance.
//+------------------------------------------------------------------+
//|а.mq4 |
//|Valery Wilkes |
//|https://www.mql5.com ||
//+------------------------------------------------------------------+
#property copyright "Valery Wilkes"
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
double iAlligator();
bool ObjectSetInteger();
long a=ChartOpen("EURUSD",PERIOD_M5);
//+------------------------------------------------------------------+
//| Expert initialization function|
//+------------------------------------------------------------------+
int OnInit()
{
//--- create timer
EventSetTimer(5);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function|
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//--- destroy timer
EventKillTimer();
}
//+------------------------------------------------------------------+
//| expert tick function|
//+------------------------------------------------------------------+
void OnTick()
{
for(int f=3;; f++)
{
double val=iFractals("EURUSD",15,1,f);
if(val!=0)
{
Alert("Buy Fractal",val, "Bar Left",f);
break;
}
}
for(int f1=3;; f1++)
{
double val1=iFractals("EURUSD",15,2,f1);
if(val1!=0)
{
Alert("Fractal to sell ",val1, "Bar left",f1);
break;
}
Alert(Bid);
}
}
//+------------------------------------------------------------------+
//| Timer function|
//+------------------------------------------------------------------+
void OnTimer()
{
}
//+------------------------------------------------------------------+
//| Tester function|
//+------------------------------------------------------------------+
double OnTester()
{
//---
double ret=0.0;
//---
//---
return(ret);
}
//+------------------------------------------------------------------+
Good afternoon. I have such a problem. I have started studying MQL, and I am writing an Expert Advisor. When I compile and run the Expert Advisor, it opens EURUSD hourly chart, but I have not specified yet which chart to open. I have prescribed the opening of Euro dollar for 5 minutes. First it opens Euro dollar by an hour, and then by 5 minutes. How can I delete the hour chart? Here is the code of the Expert Advisor. Thanks for the tip in advance.
You must be enabling debugging and then your EA starts on the default symbol. Specify the required symbol and TF in the metaeditor settings. (See attached picture).
So in this piece we are looking for max and min values from maximum to minimum ?
and in this
from min to max?
This code:
searches for the index of the element with the maximum value. The search is performed starting from element zero and through the whole array.
Here's the code
and this is the result:
Explore, please.