Hello, could you please tell me how to make the indicator in the tester work with data of another currency pair?
The picture shows a normal MACD, but with the "GBPUSD" symbol written on it. On the "EURUSD" chart, it's drawing exactly the same way as on the "GBPUSD" chart.
But it does not want to work in the Strategy Tester. When I press pause and place indicator on EURUSD chart, at first everything is drawn correctly, but as soon as I start test
It just draws a straight line like in the picture. Or maybe you can tell me another indicator that works. It's not the MACD that is important but the principle of drawing.
Can you tell me how to write the current time into a global variable GlobalVariableSet, for example? It doesn't give out the date at all but a set of digits...
Can you tell me how to write the current time into a global variable GlobalVariableSet, for example? It doesn't give out the date at all but a set of digits...
With the new build, the objects in the bottom right corner have crawled to the right. It is necessary to move them slightly to the left so that all the text in them was readable.
As it was and as it should be done:
Now they have crawled away:
Code:
#include <stdlib.mqh>
#include <stderror.mqh>
#include <WinUser32.mqh>
//--------------------------------------------------------------- 3 --#include <Variables_AU.mqh> // Описание переменных #include <Terminal.mqh> // Учёт ордеров#include <Events.mqh> // Функция слежения за событиями, обновлен.#include <Inform.mqh> // Информационная функция#include <Trade.mqh> // Торговая функция#include <Open_Ord.mqh> // Открытие одного ордера заданного типа#include <Open_Ord_balance_line.mqh> //Доливка по линии баланса - установка одного отложенного ордера #include <Close_All.mqh> // Закрытие всех ордеров заданного типа#include <Tral_Stop_All.mqh> // Модификация лимитного ордера#include <Lot_MM.mqh> // Вычисление количества лотов#include <Criterion.mqh> // Торговые критерии#include <Errors.mqh> // Функция обработки ошибок.//--------------------------------------------------------------- 4 --int init() // Спец. функция init
{
IsExpertStopped = false;
if (!IsTradeAllowed()) {Comment("Необходимо разрешить советнику торговать");IsExpertStopped = true; return (0);}
// if (!IsTesting()){if (IsExpertEnabled()) Comment("Советник запустится следующим тиком");else Comment("Отжата кнопка \"Разрешить запуск советников\"");} // Определяем переменные окружения
Level_old=MarketInfo(Symbol(),MODE_STOPLEVEL );//Миним. дистаниция
Level_Freeze = MarketInfo(Symbol(),MODE_FREEZELEVEL );
Spread = MarketInfo(Symbol(),MODE_SPREAD);
Tick = MarketInfo(Symbol(), MODE_TICKSIZE); //Mинимальный тик // Пересчеты пунктов для пятизначного ДЦ if ((Digits == 3) || (Digits == 5)){SlipPips = SlipPips*10; indent_Hight = indent_Hight * 10; indent_Low = indent_Low * 10;}
Terminal(); // Функция учёта ордеров //----------------------------------------------Мониторинг--------------------- if(Monitor==true)
{
int a,y;
for(a=0,y=5;a<=4;a++)
{
string N=DoubleToStr(a,0);
ObjectCreate(N,OBJ_LABEL,0,0,0,0,0,0,0);
ObjectSet(N,OBJPROP_CORNER,3);
ObjectSet(N,OBJPROP_XDISTANCE,5);
ObjectSet(N,OBJPROP_YDISTANCE,y);
y+=20;
}
}
return(0); // Выход из init()
}
//-----------------------------------------------------------------------------int start() // Спец. функция start
{
//------------- Вызов ф-ий учёта ордеров, принятия торговых решений и информации ----------
Terminal(); // Функция учёта ордеров
Events(); // Информация о событиях
Trade (Criterion()); // Торговая функция
Inform(0); // Для перекрашивания объектов//------------- МОНИТОРИНГ --------------------------------------------------------------if(Monitor==true)
{
string str="Balance: "+DoubleToStr(AccountBalance(),2)+" $";
ObjectSetText("0",str,10,"Arial Black",DarkOrange);
str="Profit: "+DoubleToStr(AccountProfit(),2)+" $";
ObjectSetText("1",str,10,"Arial Black",Salmon);
str="Free Margine: "+DoubleToStr(AccountFreeMargin(),2)+" $";
ObjectSetText("2",str,10,"Arial Black",Gold);
str="OrdersTotal: "+DoubleToStr(OrdersTotal(),0);
ObjectSetText("3",str,10,"Arial Black",MediumAquamarine);
if (Lot_MM()==false) // Средств не хватает на миним.return(0); // Выход из пользов. функции
str="Lots_Next: "+DoubleToStr(Lots_New,2);
ObjectSetText("4",str,10,"Arial Black",Olive);
}
return(0); // Выход из start()
}
//-------------------------------------------------------------------------------------------int deinit() // Спец. функция deinit()
{
Inform(-1); // Для удаления объектов//----------------------------------------------------------------------------------------if(Monitor==true)
{
for(int a=0;a<=4;a++)
{
string N=DoubleToStr(a,0);
ObjectDelete(N);
}
}
//-------------------------------------------------------------------------------------------return(0); // Выход из deinit()
}
//-------------------------------------------------------------------------------------------
This is a text object. But I need to change it in OBJ_TREND. I would like to be able to do this in one object, instead of adding another text object to the trend line.
Since the middle of the day on 5 May, the Debugger has stopped giving out variable values at the breakpoint. In all programs for all variables. At the same time, the programs themselves work as before. At that time (and until now) Editor was "ver. 5.00 build 934" and MetaTrader "ver. 4.00 build 646" .
Here is a simple script, and this is what the Debugger shows. Can you please tell me what's wrong?
Since the middle of the day on 5 May, the Debugger has stopped giving out variable values at the breakpoint. In all programs for all variables. At the same time the programs themselves work as before. At that time (and until now) Editor was "ver. 5.00 build 934" and MetaTrader "ver. 4.00 build 646" .
Here is a simple script, and this is what the Debugger shows. Can you please tell me what's wrong?
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, could you please tell me how to make the indicator in the tester work with data of another currency pair?
The picture shows a normal MACD, but with the "GBPUSD" symbol written on it. On the "EURUSD" chart, it's drawing exactly the same way as on the "GBPUSD" chart.
But it does not want to work in the Strategy Tester. When I press pause and place indicator on EURUSD chart, at first everything is drawn correctly, but as soon as I start test
It just draws a straight line like in the picture. Or maybe you can tell me another indicator that works. It's not the MACD that is important but the principle of drawing.
Can you tell me how to write the current time into a global variable GlobalVariableSet, for example? It doesn't give out the date at all but a set of digits...
Can you tell me how to write the current time into a global variable GlobalVariableSet, for example? It doesn't give out the date at all but a set of digits...
Time is stored as an integer value
Hello. Happy Victory Day, everyone!
With the new build, the objects in the bottom right corner have crawled to the right. It is necessary to move them slightly to the left so that all the text in them was readable.
As it was and as it should be done:
Now they have crawled away:
Code:
I managed it myself by changing the reference angle and setting the coordinate distances:
And how do you change the size and background (colour is probably unlikely) of object comments?
Well the Start # ticket number in the picture is theirs.
Function:
Last three, parameters thought they affect somehow. No way...
The Debugger has stopped working - why?
Since the middle of the day on 5 May, the Debugger has stopped giving out variable values at the breakpoint. In all programs for all variables. At the same time, the programs themselves work as before. At that time (and until now) Editor was "ver. 5.00 build 934" and MetaTrader "ver. 4.00 build 646" .
Here is a simple script, and this is what the Debugger shows. Can you please tell me what's wrong?
The Debugger has stopped working - why?
Since the middle of the day on 5 May, the Debugger has stopped giving out variable values at the breakpoint. In all programs for all variables. At the same time the programs themselves work as before. At that time (and until now) Editor was "ver. 5.00 build 934" and MetaTrader "ver. 4.00 build 646" .
Here is a simple script, and this is what the Debugger shows. Can you please tell me what's wrong?