Hello. 2020.10.28_05:19:00 GMT+3. I translated the LeManTrend_Indicator.mq5 indicator into the fourth version .mq4 . The indicator appears on the chart, but when I try to switch GBPUSD,H1 to M5 timeframe, MetaTrader4 hangs, CPU is overloaded. I have to close MetaTrader4 and open it again. No freezes when I remove LeManTrend_Indicator.ex4 from the chart. I do not understand what is wrong in the indicator code. Who can give me a hint? How to fix it?
And LeMan_BrainTrend1Sig.mq5 converted to the fourth version, it is in the list of indicators, but nothing appears on the chart. How to rewrite the code of this indicator to make it work properly, I do not know. I have written only Expert Advisors before. How to check them in strategytester- I know. And when I write Print() of variables in the code, it becomes clear what is wrong. I do not know how to check the indicators. I wrote Print() in the code, it is not saved in any log. Will someone advise me what to do with indicators to make them work, not to take up space on the hard disk? Looking forward to hearing from you. 05:44 GMT+3.
Yes I'll post the indicator codes now. One more thing. Why have I converted indicators from .mq5 to .mq4 ? Because my broker has ruble accounts only in MetaTrader4. And indicators are written in fifth version. And I need indicators to write a profitable Expert Advisor for MetaTrader4. That's it now. 05:53 GMT+3.
Тестер стратегий позволяет тестировать и оптимизировать торговые стратегии (советники) перед началом использования их в реальной торговле. При тестировании советника происходит его однократная прогонка с начальными параметрами на исторических данных. При оптимизации торговая стратегия прогоняется несколько раз с различным набором параметров...
Hello. 2020.10.28_05:19:00 GMT+3. I translated the LeManTrend_Indicator.mq5 indicator into the fourth version .mq4 . The indicator appears on the chart, but when I try to switch GBPUSD,H1 to M5 timeframe, MetaTrader4 hangs, CPU is overloaded. I have to close MetaTrader4 and open it again. No freezes when I remove LeManTrend_Indicator.ex4 from the chart. I do not understand what is wrong in the indicator code. Who can give me a hint? How to fix it?
And LeMan_BrainTrend1Sig.mq5 converted to the fourth version, it is in the list of indicators, but nothing appears on the chart. How to rewrite the code of this indicator to make it work properly, I do not know. I have written only Expert Advisors before. How to check them in strategytester- I know. And when I write Print() of variables in the code, it becomes clear what is wrong. I do not know how to check the indicators. I wrote Print() in the code, it is not saved in any log. Will someone advise me what to do with indicators to make them work, not to take up space on the hard disk? Looking forward to hearing from you. 05:44 GMT+3.
Yes I'll post the indicator codes now. One more thing. Why have I converted indicators from .mq5 to .mq4 ? Because my broker has ruble accounts only in MetaTrader4. And indicators are written in fifth version. And I need indicators to write a profitable Expert Advisor for MetaTrader4. That's it now. 05:53 GMT+3.
it also works in 4 - but you need to remove the repeating (string ) before (err_text)
string err_text=(TerminalInfoString(TERMINAL_LANGUAGE)=="Russian")?
"Параметр \"Midle\" меньше 1!":
"Parameter \"Midle\" is less than 1!";
it would look like this
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- check "MA averaging period" parameterif(PeriodEMA<1)
{
string err_text=(TerminalInfoString(TERMINAL_LANGUAGE)=="Russian")?
"Параметр \"MA averaging period\" меньше 1!":
"Parameter \"MA averaging period\" is less than 1!";
//--- when testing, we will only output to the log about incorrect input parametersif(MQLInfoInteger(MQL_TESTER))
{
Print(__FILE__," ",__FUNCTION__,", ERROR: ",err_text);
return(INIT_FAILED);
}
else// if the Expert Advisor is run on the chart, tell the user about the error
{
Alert(__FILE__," ",__FUNCTION__,", ERROR: ",err_text);
return(INIT_PARAMETERS_INCORRECT);
}
}
//--- check "Min" parameterif(Min<1)
{
err_text=(TerminalInfoString(TERMINAL_LANGUAGE)=="Russian")?
"Параметр \"Min\" меньше 1!":
"Parameter \"Min\" is less than 1!";
//--- when testing, we will only output to the log about incorrect input parameters
What's this situation about? Same bar index. And it seems to happen only on the first run on a symbol. Either deeper into the story. I thought the code above was just checking for bars...
//+------------------------------------------------------------------+//| Phoenix.mq4 |//| Copyright 2020, MetaQuotes Software Corp. |//| https://www.mql5.com |//+------------------------------------------------------------------+//--- setting the indicator name#property description"Phoenix"//--- set the strict mode of compilation#property strict//--- specify where to draw the indicator#property indicator_chart_window//--- specify the number of buffers#property indicator_buffers2//--- setting the color of the indicator rendering#property indicator_color1clrGreenYellow#property indicator_color2clrRed//--- we define the input parameters//--- specify arrays of indicator buffersdouble arrow_01[];
double arrow_02[];
//*********************************************//bool flag_buy = false;
bool flag_sell = false;
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit(void)
{
string short_name;
//--- we specify two additional buffers for calculations
IndicatorBuffers(2);
SetIndexBuffer(0,arrow_01);
SetIndexBuffer(1,arrow_02);
//--- setting the indicator to be drawn as a line
SetIndexStyle(0,DRAW_ARROW,EMPTY,2,clrGreenYellow);
SetIndexArrow(0,233);
SetIndexBuffer(0,arrow_01);
SetIndexStyle(1,DRAW_ARROW,EMPTY,2,clrRed);
SetIndexArrow(1,234);
SetIndexBuffer(1,arrow_02);
//--- setting a name in the DataWindow window and a label
short_name="Phoenix";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//--- if there are no errors,initialization is completed successfullyreturn(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Phoenix |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constdatetime& time[],
constdouble& open[],
constdouble& high[],
constdouble& low[],
constdouble& close[],
constlong& tick_volume[],
constlong& volume[],
constint& spread[])
{
for(int shift=rates_total; shift>=0; shift--)
{
//--- to simplify the coding and speed up access data are put into internal variablesdouble MacdCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,shift);
double SignalCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,shift);
{
if(flag_buy==false)
//--- check for long position (BUY) possibilityif(MacdCurrent>SignalCurrent)
{
arrow_01[shift]=Low[shift];
flag_buy=true;
flag_sell=false;
}
if(flag_sell==false)
//--- check for short position (SELL) possibilityif(MacdCurrent<SignalCurrent)
{
arrow_02[shift]=High[shift];
flag_buy=false;
flag_sell=true;
}
}
}
return(rates_total);
}
//+------------------------------------------------------------------+
В стрелочном индикаторе Phoenix используется комбинация трех индикаторов: Moving Average, Bolinger Bands и Momentum в сочетании с двумя мощными формулами, основанными на поведении цены текущего графика. В индикаторе Phoenix также реализована система звуковых и текстовых алертов, а также отправка...
//+------------------------------------------------------------------+//| Phoenix.mq4 |//| Copyright 2020, MetaQuotes Software Corp. |//| https://www.mql5.com |//+------------------------------------------------------------------+//--- setting the indicator name#property description"Phoenix"//--- set the strict mode of compilation#property strict//--- specify where to draw the indicator#property indicator_chart_window//--- specify the number of buffers#property indicator_buffers2//--- setting the color of the indicator rendering#property indicator_color1clrGreenYellow#property indicator_color2clrRed//--- we define the input parameters//--- specify arrays of indicator buffersdouble arrow_01[];
double arrow_02[];
//*********************************************//bool flag_buy = false;
bool flag_sell = false;
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit(void)
{
string short_name;
//--- we specify two additional buffers for calculations
IndicatorBuffers(2);
SetIndexBuffer(0,arrow_01);
SetIndexBuffer(1,arrow_02);
//--- setting the indicator to be drawn as a line
SetIndexStyle(0,DRAW_ARROW,EMPTY,2,clrGreenYellow);
SetIndexArrow(0,233);
SetIndexBuffer(0,arrow_01);
SetIndexStyle(1,DRAW_ARROW,EMPTY,2,clrRed);
SetIndexArrow(1,234);
SetIndexBuffer(1,arrow_02);
//--- setting a name in the DataWindow window and a label
short_name="Phoenix";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//--- if there are no errors,initialization is completed successfullyreturn(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Phoenix |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constdatetime& time[],
constdouble& open[],
constdouble& high[],
constdouble& low[],
constdouble& close[],
constlong& tick_volume[],
constlong& volume[],
constint& spread[])
{
for(int shift=rates_total; shift>=0; shift--)
{
//--- to simplify the coding and speed up access data are put into internal variablesdouble MacdCurrent=iCustom(NULL,0,"LeManTrend",13,21,34,3,MODE_MAIN,shift);
double SignalCurrent=iCustom(NULL,0,"LeManTrend",13,21,34,3,MODE_SIGNAL,shift);
{
if(flag_buy==false)
//--- check for long position (BUY) possibilityif(MacdCurrent>SignalCurrent)
{
arrow_01[shift]=Low[shift];
flag_buy=true;
flag_sell=false;
}
if(flag_sell==false)
//--- check for short position (SELL) possibilityif(MacdCurrent<SignalCurrent)
{
arrow_02[shift]=High[shift];
flag_buy=false;
flag_sell=true;
}
}
}
return(rates_total);
}
//+------------------------------------------------------------------+
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello. 2020.10.28_05:19:00 GMT+3. I translated the LeManTrend_Indicator.mq5 indicator into the fourth version .mq4 . The indicator appears on the chart, but when I try to switch GBPUSD,H1 to M5 timeframe, MetaTrader4 hangs, CPU is overloaded. I have to close MetaTrader4 and open it again. No freezes when I remove LeManTrend_Indicator.ex4 from the chart. I do not understand what is wrong in the indicator code. Who can give me a hint? How to fix it?
And LeMan_BrainTrend1Sig.mq5 converted to the fourth version, it is in the list of indicators, but nothing appears on the chart. How to rewrite the code of this indicator to make it work properly, I do not know. I have written only Expert Advisors before. How to check them in strategytester- I know. And when I write Print() of variables in the code, it becomes clear what is wrong. I do not know how to check the indicators. I wrote Print() in the code, it is not saved in any log. Will someone advise me what to do with indicators to make them work, not to take up space on the hard disk? Looking forward to hearing from you. 05:44 GMT+3.
Yes I'll post the indicator codes now. One more thing. Why have I converted indicators from .mq5 to .mq4 ? Because my broker has ruble accounts only in MetaTrader4. And indicators are written in fifth version. And I need indicators to write a profitable Expert Advisor for MetaTrader4. That's it now. 05:53 GMT+3.
Hello. 2020.10.28_05:19:00 GMT+3. I translated the LeManTrend_Indicator.mq5 indicator into the fourth version .mq4 . The indicator appears on the chart, but when I try to switch GBPUSD,H1 to M5 timeframe, MetaTrader4 hangs, CPU is overloaded. I have to close MetaTrader4 and open it again. No freezes when I remove LeManTrend_Indicator.ex4 from the chart. I do not understand what is wrong in the indicator code. Who can give me a hint? How to fix it?
And LeMan_BrainTrend1Sig.mq5 converted to the fourth version, it is in the list of indicators, but nothing appears on the chart. How to rewrite the code of this indicator to make it work properly, I do not know. I have written only Expert Advisors before. How to check them in strategytester- I know. And when I write Print() of variables in the code, it becomes clear what is wrong. I do not know how to check the indicators. I wrote Print() in the code, it is not saved in any log. Will someone advise me what to do with indicators to make them work, not to take up space on the hard disk? Looking forward to hearing from you. 05:44 GMT+3.
Yes I'll post the indicator codes now. One more thing. Why have I converted indicators from .mq5 to .mq4 ? Because my broker has ruble accounts only in MetaTrader4. And indicators are written in fifth version. And I need indicators to write a profitable Expert Advisor for MetaTrader4. That's it now. 05:53 GMT+3.
LeManTrend_Indicator.mq5- the indicator itself herehttps://www.mql5.com/ru/code/27570
it also works in 4 - but you need to remove the repeating (string ) before (err_text)
it would look like this
LeManTrend_Indicator.mq5- the indicator itself herehttps://www.mql5.com/ru/code/27570
it also works in 4 - but you need to remove the repeating (string ) before (err_text)
it should look like this
string
BrainTrend1Sig for 4 here -https://www.mql5.com/ru/code/8772
This one should contain the already corrected LeManTrend_Indicator.mq4 for quadruplets
BrainTrend1Sig for 4 here -https://www.mql5.com/ru/code/8772
Here you need to add LeManTrend_Indicator.mq4, already fixed for 4
there is an error - you need to delete this line ( double const = 0; )
and everything will work
You're a comedian.
Who was I talking to?
What's this situation about? Same bar index. And it seems to happen only on the first run on a symbol. Either deeper into the story. I thought the code above was just checking for bars...
Here is a good indicatorhttps://www.mql5.com/ru/code/28364
Everything you need can be built into it !!!!!!!
Good afternoon!
Please help me with the following task:
I need to run a script (Python) from MQL4 Expert Advisor. I'm trying to do it using ShellExecuteW() in the following way:
I get a file access error. The script is running but the code does not go further.
I will be glad if you can share the function to run the script.
Another question: how do I check the script's execution?
Hello! 2020.10.28_05:19:00 GMT+3. I translated the LeManTrend_Indicator.mq5 indicator into the fourth version .mq4 .
This one does not fit
https://www.mql5.com/ru/code/9096
And this one doesn't fit.
https://www.mql5.com/ru/code/9096
This one seems to be better.