1. An EA will trade a series of orders (buy-sell-buy-sell-...). The series will end with the order which closed with a profit. How to implement it?
2. The next problem. The first series has not yet been completed (we have not had a profit order), and the second one is already started. How to "split" them for the Expert Advisor?
1. An EA will trade a series of orders (buy-sell-buy-sell-...). The series will end with the order which closed with a profit. How to implement it?
2. The next problem. The first series has not yet been completed (we have not had a profit order), and the second one is already started. How to "split" them for the Expert Advisor?
Good afternoon, everyone. Continuing to saw the Grail MachineJ. I have to redo the code with a bias towards using functions, because I'm sick of scrolling through a ton of code. I want to move the functions to separate include files. I have created function for getting signal by ao indicator in EA's file for trial and it works fine.
My robot even opens trades. But if I create a plugin file SIGNALS_INDIKATOR. I connect it in my Expert Advisor like this.
//+------------------------------------------------------------------+//| TREND+_V_1.0 |//| ДАНЯ ГАГАРКИН |//| https://vk.com/danila_mastep |//+------------------------------------------------------------------+#property copyright"ДАНЯ ГАГАРКИН"#property link"https://vk.com/danila_mastep"#property version"1.00"#property strict//НАЧАЛО ВХОДНЫХ ПЕРЕМЕННЫХ И ГЛОБАЛЬНЫХ ПЕРЕМЕННЫХ------------------------------------------------------------------------------------------+int intBars;// ПЕРЕМЕННАЯ ДЛЯ ОПЕРДЕЛЕНИЯ КОЛИЧЕСТВА БАРОВ, ЧТОБЫ ОПРЕДЕЛИТЬ ПОЯВЛЕНИЕ НОВОГО#include <TREND+\SIGNALS_INDIKATOR.mqh>
// А НИЖЕ ПОШЛИ ЕНУМЫ И ЭКСТЕРН ПЕРЕМЕННЫЕ
I also write my function for getting signals by this type of attachment, but this function doesn't show my external variables which I have easily passed to the EA itself. The function of getting indicator's value in my EA is like this.
//НАЧАЛО ПОЛУЧЕНИЯ ДАННЫХ ПО АО СЕЛЛ------------------------------------------------------------------------------------------+double f_ao_sell()
{ double ao_sell = iCustom(Symbol(),PeriodForWork, //Таймфрейм на котором искать дивергенции"1)SEARCH_DIVERGENCE",
Params, // Параметры транслирования сигналов
ModeSignalsCTS, // транслировать сигналы в cts?
LifetimeOfSignal, //Время жизни сигнала в баарх рабочего тф
CTS_Name, // имя для cts
Div_Params, // параметры поиска дивергенции
PeriodForWork, // Таймфрейм на котором искать дивергенции
SearchAccuracy, // Режим поиска совпадений
NumBarAccuracy, // количество баров не точности поиска пиков
KoeffDistanceBetween,// коэффициент разницы между экстремумами
WidthChartLine, // толщина линий на графике цены
WidthIndicatorstLine,// толщина линий в окне индикаторов
ShiftArrow, // смещение значков
AO_Params, // Параметры АО
UseAO, // Искать дивергенции на АО
ColorUpperAO, // цвет верхних линий дивергенций АО
ColorLowerAO, // цвет нижних линий дивергенций АО
Stoch_Params, // параметры стохастик
UseStoch, // искать дивергенции на стохастик
ModeLineSTO, // ИСКАТЬ ДИВЕРГЕНЦИИ ПО ЛИНИИ STOCHASTIC:
Period_K, // период %К стохастик
Period_D, // период %Д стохастик
Slowing, // замедление стохастик
AppledPriceSTO, // цены расчёта стохастик
MethodMAStoch, // метод МА стохастик
UpperLevelSTO, // верхний уровень стохастик
LowerLewelSTO, // нижний уровень стохастик
ColorUpperSTO, // цвет верхних линий дивергенций стохастик
ColorLowerSTO, // ЦВЕТ НИЖНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ STOCHASTIC
RSI_Params, // ПАРАМЕТРЫ RSI
UseRSI, // ИСКАТЬ ДИВЕРГЕНЦИИ НА RSI?
PeriodRSI, // ПЕРИОД RSI
AppledPriceRSI, // ПРИМЕНИТЬ К
UpperLevelRSI, // ВЕРХНИЙ УРОВЕНЬ RSI
LowerLewelRSI, // НИЖНИЙ УРОВЕНЬ RSI
ColorUpperRSI, // ЦВЕТ ВЕРХНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ RSI
ColorLowerRSI, // ЦВЕТ НИЖНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ RSI
MACD_Params, // ПАРАМЕТРЫ MACD
UseMACD, // ИСКАТЬ ДИВЕРГЕНЦИИ НА MACD
ModeLineMACD, // ИСКАТЬ ДИВЕРГЕНЦИИ ПО ЛИНИИ MACD:
FastEMA_MACD, // БЫСТРОЕ EMA MACD
SlowEMA_MACD, // МЕДЛЕННОЕ EMA MACD
PeriodSignalMACD, // ПЕРИОД СИГНАЛЬНОЙ SMA MACD
AppledPriceMACD, // ПРИМЕНИТЬ К:
ColorUpperMACD, // ЦВЕТ ВЕРХНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ MACD
ColorLowerMACD, // ЦВЕТ НИЖНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ MACD
Notifications_Params, // ПАРАМЕТРЫ ОПОВЕЩЕНИЙ
UseAlerts, // ОПОВЕЩАТЬ В ТЕРМИНАЛЕ О СИГНАЛЕ
UseMail, // ОПОВЕЩАТЬ НА E-MAIL О СИГНАЛЕ
UsePush, // ОПОВЕЩАТЬ О СИГНАЛЕ НА МОБИЛЬНЫЙ 2, //ВТОРОЙ БУФЕР- АО СЕЛЛ0// СИГНАЛ НА НУЛЕВОЙ СВЕЧЕ ИЗ-ЗА ОСОБЕННОСТЕЙ ИНДИКАТОРА
);
return(ao_sell);
}//КОНЕЦ ПОЛУЧЕНИЯ ДАННЫХ ПО АО СЕЛЛ------------------------------------------------------------------------------------------+
If this function is in the EA file below the tick and the timer, the variables that are declared as externs are clearly visible in this function. But if I completely copy and paste this function into a include file, the external variables are not visible in the function.
The question is, what should I do to make external variables be visible in the functions in the include file, as well as these variables are visible in the EA functions, which I write below the timer?
Good afternoon, everyone. Continuing to saw the Grail MachineJ. I have to redo the code with a focus on using functions, because I'm sick of scrolling through a ton of code. I want to move the functions to separate include files. I have created function for getting signal by ao indicator in EA's file for trial and it works fine.
My robot even opens trades. But if I create a plugin file SIGNALS_INDIKATOR. I connect it in my Expert Advisor like this.
I also write my function for getting signals by this type of attachment, but this function doesn't show my external variables which I have easily passed to the EA itself. The function of getting indicator's value in my EA is like this.
If this function is in the EA file below the tick and the timer, the variables that are declared as externs are clearly visible in this function. But if I completely copy and paste this function into a include file, the external variables are not visible in the function.
The question is, what should I do to make external variables be visible in the functions in the include file, as well as these variables are visible in the EA functions, which I write below the timer?
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.
I myself did not understand, Alexey, where he dug up this currency pair )))
It happens... Thought about one thing, wrote about another... Same thing myself.........)))
Either skis are bad... I can't find any mention of this pair in Michail_David's posts... Everywhere it says USDJPY
Wrong track )))) Me ;) I got it wrong.
But in fact - the pair is a string and no inverted commas should be put in it.
@Michail_David
vlt - the pair you're looking for (or a bit of it :)))
Wrong track )))) Me ;) I got it wrong.
But in essence - a pair is a string and no inverted commas should be put into it.
@Michail_David
vlt - sought pair (or part of it :)))
Sergey, thank you. I understand the idea.
Hello. Please advise.
1. An EA will trade a series of orders (buy-sell-buy-sell-...). The series will end with the order which closed with a profit. How to implement it?
2. The next problem. The first series has not yet been completed (we have not had a profit order), and the second one is already started. How to "split" them for the Expert Advisor?
Thank you.
Hello. Please advise.
1. An EA will trade a series of orders (buy-sell-buy-sell-...). The series will end with the order which closed with a profit. How to implement it?
2. The next problem. The first series has not yet been completed (we have not had a profit order), and the second one is already started. How to "split" them for the Expert Advisor?
Thank you.
1 The condition is too vague to help...
2 Use different "magiks"
Good afternoon, everyone. Continuing to saw the Grail MachineJ. I have to redo the code with a bias towards using functions, because I'm sick of scrolling through a ton of code. I want to move the functions to separate include files. I have created function for getting signal by ao indicator in EA's file for trial and it works fine.
My robot even opens trades. But if I create a plugin file SIGNALS_INDIKATOR. I connect it in my Expert Advisor like this.
I also write my function for getting signals by this type of attachment, but this function doesn't show my external variables which I have easily passed to the EA itself. The function of getting indicator's value in my EA is like this.
If this function is in the EA file below the tick and the timer, the variables that are declared as externs are clearly visible in this function. But if I completely copy and paste this function into a include file, the external variables are not visible in the function.
The question is, what should I do to make external variables be visible in the functions in the include file, as well as these variables are visible in the EA functions, which I write below the timer?
Good afternoon, everyone. Continuing to saw the Grail MachineJ. I have to redo the code with a focus on using functions, because I'm sick of scrolling through a ton of code. I want to move the functions to separate include files. I have created function for getting signal by ao indicator in EA's file for trial and it works fine.
My robot even opens trades. But if I create a plugin file SIGNALS_INDIKATOR. I connect it in my Expert Advisor like this.
I also write my function for getting signals by this type of attachment, but this function doesn't show my external variables which I have easily passed to the EA itself. The function of getting indicator's value in my EA is like this.
If this function is in the EA file below the tick and the timer, the variables that are declared as externs are clearly visible in this function. But if I completely copy and paste this function into a include file, the external variables are not visible in the function.
The question is, what should I do to make external variables be visible in the functions in the include file, as well as these variables are visible in the EA functions, which I write below the timer?
external variables - what are they?
I will insert a piece of code with them-
I have highlighted the external variables in yellow. These variables are displayed when the EA is attached to the chart in the input parameters tab
I will insert a piece of code with them-
I have highlighted the external variables in yellow. These variables are displayed when the EA is attached to the chart in the input parameters tab
Now they use "input" instead of "extern".
You also need to move your "extern variables" to the SIGNALS_INDIKATOR.mqh library
I will insert a piece of code with them-
The global variables in the EA body are only visible to the EA and not to the plugins,
but global variables in the body of the plugin are visible everywhere.