Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 788

 
Rita:

Good afternoon.

Please advise. I am opening a position:

How can I set the position comment to display theMagic value after the word number?

I.e. in this case: Number 20781

You can also do this:

   int mag=111222333;
   string str="Сложение строки и числа ";
   str=str+mag;
   Alert(str);

When adding variables of different types, the result is converted to the variable type with the highest priority. String has a higher priority than int

 
TarasBY:
You have the OrderCloseTime() time to close the losing position. From it you can read the time through TimeCurrent() - OrderCloseTime(). Or in bars using iBarShift (NULL, 0, OrderCloseTime()).

Thank you!
 
Hi, can you tell me if it is possible to call a standard indicator (e.g. MA) from an EA and have it appear on the chart? I don't need its value in a certain point, it's understandable, but exactly it should be drawn on the chart? Thank you
 
alxm:
Hi, can you tell me if it is possible to call a standard indicator (e.g. MA) from an EA so that it can be displayed on the chart? I don't need its value in a certain point, it's understandable, but exactly it should be drawn on the chart? Thank you

You can, only with API, and only with default parameters.
Or Vadim Zhunko's library. What is closer to you? The essence is the same - you have to implement parameter passing from EA to the indicator.

Library.

 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 // 7. ФУНКЦИИ ДЛЯ УПРАВЛЕНИЯ ПРОГРАММАМИ MQL4.
 //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 // 7.1. Функция удаляет эксперт с указанного графика. В случае успеха функция возвращает TRUE, иначе - FALSE.
 bool ServiceDeleteExpert(int hwndChart); // Системный дескриптор окна графика, удаляемого эксперта.
 //===============================================================================================================================================
 // 7.2. ФУНКЦИЯ удаляет индикаторы по имени из списка загруженных индикаторов.
 void ServiceDeleteIndicatorsByName(int     hwndChart,         // Системный дескриптор окна, куда прикреплен индикатор.
                                    int     nWindow,           // Номер подокна для удаления индикаторов. Если -1, то удаляются индикаторы из всех подокон.
                                    string &asIndicatorName[], // Одномерный массив с именами удаляемых индикаторов.
                                    int     nNumberName);      // Количество имён индикаторов в массиве.
 //===============================================================================================================================================
 // 7.3. Функция удаляет скрипт с указанного графика. В случае успеха функция возвращает TRUE, иначе - FALSE.
 bool ServiceDeleteScript(int hwndChart); // Системный дескриптор окна графика, удаляемого скрипта.
 //===============================================================================================================================================
 // 7.4. Функция управляет диалоговым окном завершения скрипта и возвращает системный дескриптор диалогового окна завершения скрипта, если окно есть,
 //      иначе - NULL. Функция работает только с русской и английской локализациями.
 int ServiceDialogScript(int bInstruction); // Команда для диалогового окна завершения скрипта: TRUE - завершить скрипт, FALSE - не завершать скрипт.
 //===============================================================================================================================================
 // 7.5. Функция получает имена индикаторов из списка загруженных индикаторов.
 //      В случае успеха функция возвращает количество индикаторов в указанных подокнах параметром "nWindow", иначе ноль.
 int ServiceGetNamesIndicators(int     hwndChart,         // Системный дескриптор окна, куда прикреплен индикатор.
                               int     nWindow,           // Номер подграфика. Если -1, то считываются имена индикаторов из всех подокон.
                               string &asIndicatorName[], // Одномерный строковый массив для приёма имён индикаторов.
                                                          // Массив должен быть инициализирован разными значениями в каждой ячейке!
                                                          // Это особенность инициализации строковых массивов в MQL4.
                               int     nNumberName);      // Размер массива "asIndicatorName[]" для приёма имён индикаторов.
 //===============================================================================================================================================
 // 7.6. Функция возвращает TRUE, если окно свойств эксперта открыто, иначе - FALSE.
 bool ServiceIsPropertiesExpert(string sNameExpert); // Имя эксперта, для которого контроллируется открытие окна.
 //===============================================================================================================================================
 // 7.7. Функция открывает окно списка индикаторов. Функция ожидает открытия окна в течении 2,5 секунд. Если окно не появилось в течении этого времени,
 //      функция возвращает FALSE.
 bool ServiceListIndicators(int hwndChart); // Системный дескриптор окна графика, на котором вызывается окно списка индикаторов.
 //===============================================================================================================================================
 // 7.8. Функция загружает на указанный график пользовательский индикатор по его имени.
 void ServiceLoadCustomIndicator(int    hwndChart,      // Системный дескриптор окна графика, куда загружается индикатор.
                                 string sNameIndicator, // Имя загружаемого индикатора.
                                 int    bOK);           // Подтверждение запуска индикатора, при наличии диалогового окна свойств индикатора.
                                                        // TRUE - автонажатие на кнопку "OK" разрешено, FALSE - автонажатие на кнопку "OK" запрещено.
 //===============================================================================================================================================
 // 7.9. Функция загружает на указанный график эксперт по его имени.
 void ServiceLoadExpert(int    hwndChart,   // Системный дескриптор окна графика, куда загружается эксперт.
                        string sNameExpert, // Имя загружаемого эксперта.
                        int    bOK);        // Подтверждение запуска эксперта, при наличии диалогового окна свойств эксперта.
                                            // TRUE - автонажатие на кнопку "OK" разрешено, FALSE - автонажатие на кнопку "OK" запрещено.
 //===============================================================================================================================================
 // 7.10. Функция загружает на указанный график скрипт по его имени.
 void ServiceLoadScript(int    hwndChart,   // Системный дескриптор окна графика, куда загружается скрипт.
                        string sNameScript, // Имя загружаемого скрипта.
                        int    bOK);        // Подтверждение запуска скрипта, при наличии диалогового окна свойств скрипта. Скрипт может не иметь окна свойств!
                                            // При использовании функции для загрузки скрипта из скрипта на текущем графике параметр не работает из-за
                                            // невозможности одновременной работы двух скриптов на одном графике.
                                            // TRUE - автонажатие на кнопку "OK" разрешено, FALSE - автонажатие на кнопку "OK" запрещено.
 //===============================================================================================================================================
 // 7.11. Функция загружает на указанный график стандартный индикатор по его имени.
 void ServiceLoadStdIndicator(int    hwndChart,      // Системный дескриптор окна графика, куда загружается индикатор.
                              string sNameIndicator, // Имя загружаемого индикатора.
                              int    bOK);           // Подтверждение запуска индикатора, при наличии диалогового окна свойств индикатора.
                                                     // TRUE - автонажатие на кнопку "OK" разрешено, FALSE - автонажатие на кнопку "OK" запрещено.
 //===============================================================================================================================================
 
logut:

good day!!! friends! comrades! respect to you pros!!!

i need help!!! My eyes are puffy, my head hurts, i can't prescribe it so my EA has moved StopLoss to the specified points in profit at the current price!!!

That is, when the price moved to a given point, StopLoss moved there!!!

my example does not fit.

What's not to like?

 
ALXIMIKS:

Can, only with API, and only with default parameters.
Or Vadim Zhunko's library. What is closer to you. The idea is the same - you have to implement the passing of parameters from EA to the indicator.

I.e. using the standard means will not work. Thank you!
 
alxm:
I.e. it won't work by standard means. Thank you!
We can use objects to build
 

Good people!!!

Help me find a bug.I'm learning about Arrays.

I created an array in a include file.

I put a reference to the include file in my Expert Advisor.

I can't understand why.

In the file location link error codes

http://clip2net.com/s/jkTd89

double mass[]={
1.38890,
1.40510,
1.40980,
1.41340,
2.07850};
#include <ВКЛ.ФАЙЛ.mqh>
int ot ;
int ht ;
double X ;
double X1 ;
double X2 ;

int start()     
{
ot = OrdersTotal();     
double value = Bid;
int S = ArrayBsearch(mass,  value, WHOLE_ARRAY,  0, MODE_ASCEND);
if (ot==0)
if(Bid == mass[S])
OrderSend(Symbol(),OP_SELL,0.1,Bid ,3,Ask+1000*Point,Ask-300*Point,"jfh",123 );

return;
}

Thank you.

 
solnce600:

Good people!!!

Help me find a bug.I'm learning about Arrays.

I created an array in a include file.

I put a reference to the include file in my Expert Advisor.

I can't understand why.

In the file location link error codes

http://clip2net.com/s/jkTd89

Thank you.

On the first line there was a message that the compiler could not find the file to include
 
Hi all! Dear comrades, help with the following question. Standard OSM indicator + MA indicator (only lowered to the basement). How to take a reading of MA indicator down to the basement? If we use the standard MA indicator, we apply a price from 0 to 6, and if we descend to the basement, we set "apply to" to 8. I suppose we need to change the MA indicator itself (only what to change there, I do not know) and then use the iCustom function.

I would be grateful for your help.


Reason: