What do you mean by"masking format "? As usual, e.g. "*.csv", separately specify the directory to start the search.
Well, "usually" can be different. The standard ones for OS can be extended according to your needs. For example, you can specify date in name in different formats, etc.
Aleksey Vyazmikin: Looking for a function to search the directory of a file by mask, the search should go through all subdirectories, the function should return an array with the full path of the file. Please share such a function.
If such a question arises, it means that it is too early to solve such a problem, you need to learn the basics. But now, instead of the evil me, some kind people will come and calmly explain everything.
And I'll just ask - have you looked at what is going on in this method at all?
I probably got it right initially that the method won't be called, because I've overridden the function and I'm going to implement my algorithm. I already implemented an algorithm for order processing in the method. I only know MQL5 in C/C++ but I wrote it a long time ago. I regretted my question :)
Well, "usually" can be different. The standard operating system can also be extended to suit your needs. For example the date in the name can be set in different formats, etc.
I don't see the point in making it more complicated.
Good afternoon everyone. I'm trying to write an adviser on a custom indicator.
On the chart, he draws arrows like this
The indicator has so many settings. First part.
and the second part of the settings
The indicator looks for divergences based on one of the 4 classic indicators - ao, stochastic, rsi, macd .
The peculiarity of the indicator is that it draws a signal arrow when the candle opens, that is at zero bar and while the candle is being formed, the arrow hangs, and after the candle is closed, it is not redrawn.
The indicator has 8 buffers. Because 8 arrows can be drawn - 4 for sale for each of the standard indicators and 4 for purchase.
It looks like this in the data window:
Like me I understand the zero buffer is the arrow on the stochastics on the villages. The first buffer is an arrow on the stochastic for a buy. The second buffer arrow on the ao sat down. The third buffer is an ao to buy arrow. The fourth buffer is an arrow on rsi to sit down. The fifth is the rsi arrow for buy. The sixth is the MACD arrowto the village And the seventh buffer is the MACD arrow for a buy.
I transferred all the input parameters of the indicator to the EA:
enum enumCoincidence
{
enCoinAccurate= 1 , // Точный
enCoinApproximate= 0 , // Приближенный
};
enum enumYN
{
enYes= 1 , // Да
enNo= 0 , // Нет
};
enum enumModeLINE
{
enMdMain=MODE_MAIN, // Main
enMdSign=MODE_SIGNAL, // Signal
};
enum enumSignalsMode
{
enBuy= 0 , // Только Buy
enSell= 1 , // Только Sell
enBoth= 2 , // Buy и Sell
};
externstring Params = "-- ПАРАМЕТРЫ ОТКРЫТИЯ СДЕЛКИ --" ; //======================================externdouble lot= 0.01 ; // ЛОТ ОРДЕРАexternint slippages= 5 ; // ПРОСКАЛЬЗЫВАНИЕexterndouble sl= 100 ; // СТОП ЛОС СДЕЛКИexterndouble tp= 100 ; // ТЕЙК ПРОФИТ СДЕЛКИexternstring coment= "trendova9_divepgenci9" ; // КОМЕНТАРИЙ СОВЕТНИКАexternint magik_number= 123 ; // МАГИЧЕСКИЙ НОМЕР СОЕВТНИКАexterncolor Color = clrRed ; // ЦВЕТ ОРДЕРОВ СОВЕТНИКАexternstring Params_tranclirpvani9 = "-- ПАРАМЕТРЫ ТРАНСЛИРОАВНИЯ СИГНАЛОВ --" ; //======================================externstring CTS_Params = "-- Параметры транслирования сигналов В CTS --" ; //======================================extern enumSignalsMode ModeSignalsCTS = enBoth; // Транслировать сигналы в CTS:externint LifetimeOfSignal = 5 ; // Время жизни сигнала в барах рабочего ТФexternstring CTS_Name = "123" ; // Имя для CTSint lifetimeOfSignal; // Время жизни сигнала в барах рабочего тфexternstring Div_Params = "-- Параметры поиска дивергенций --" ; //======================================externENUM_TIMEFRAMES PeriodForWork = PERIOD_H4 ; // ТФ ДИВЕРГЕНЦИИENUM_TIMEFRAMES periodForWork; // ТАЙМФРЕЙМ, НА КОТОРОМ ИСКАТЬ ДИВЕРГЕНЦИИextern enumCoincidence SearchAccuracy = enCoinApproximate; // РЕЖИМ ПОИСКА СОВПАДЕНИЙexternint NumBarAccuracy = 3 ; // КОЛИЧЕСТВО БАРОВ НЕТОЧНОСТИ ПОИСКА ПИКОВint numBarAccuracy; // КОЛИЧЕСТВО БАРОВ НЕ ТОЧНОСТИ ПОИСКА ПИКОВexternint KoeffDistanceBetween = 5 ; // КОЭФФИЦИЕНТ "РАЗНИЦЫ" МЕЖДУ ЭКСТРЕМУМАМИ2double koeffForDistanceBetween; // КОЭФФИЦИЕНТ "РАЗНИЦЫ" МЕЖДУ ЭКСТРЕМУМАМИ2externint WidthChartLine = 2 ; // ТОЛЩИНА ЛИНИЙ НА ГРАФИКЕ ЦЕНЫint widthChartLine; // ТОЛЩИНА ЛИНИЙ НА ГРАФИКЕ ЦЕНЫexternint WidthIndicatorstLine = 2 ; // ТОЛЩИНА ЛИНИЙ В ОКНЕ ИНДИКАТОРОВint widthIndicatorstLine; // ТОЛЩИНА ЛИНИЙ В ОКНЕ ИНДИКАТОРОВ//--- используемые индикаторыexterndouble ShiftArrow = 1.0 ; // СМЕЩЕНИЕ ЗНАЧКОВdouble shiftArrow;
externstring AO_Params = "-- Параметры AO --" ; //======================================extern enumYN UseAO = enYes; // ИСКАТЬ ДИВЕРГЕНЦИИ НА АО?externcolor ColorUpperAO = clrRed ; // ЦВЕТ ВЕРХНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ АОexterncolor ColorLowerAO = clrBlue ; // ЦВЕТ НИЖНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ АО//---externstring Stoch_Params = "-- Параметры Stochastic --" ; //======================================extern enumYN UseStoch = enNo; // ИСКАТЬ ДИВЕРГЕНЦИИ НА STOCHASTIC??extern enumModeLINE ModeLineSTO = enMdMain; // ИСКАТЬ ДИВЕРГЕНЦИИ ПО ЛИНИИ STOCHASTIC:externint Period_K = 5 ; // ПЕРИОД %K STOCHASTICint period_K; // Период %K Stochasticexternint Period_D = 3 ; // ПЕРИОД %D STOCHASTICint period_D; // Период %D Stochasticexternint Slowing = 3 ; // ЗАМЕДЛЕНИЕ STOCHASTICint slowing; // Замедление StochasticexternENUM_STO_PRICE AppledPriceSTO = STO_CLOSECLOSE ; // ЦЕНЫ РАСЧЁТА STOCHASTICexternENUM_MA_METHOD MethodMAStoch = MODE_SMA ; // МЕТОД MA STOCHASTICexternint UpperLevelSTO = 80 ; // ВЕРХНИЙ УРОВЕНЬ STOCHASTICint upperLevelSTO; // Верхний уровень Stochasticexternint LowerLewelSTO = 20 ; // НИЖНИЙ УРОВЕНЬ STOCHASTICint lowerLewelSTO; // Нижний уровень Stochasticexterncolor ColorUpperSTO = clrRed ; // ЦВЕТ ВЕРХНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ STOCHASTICexterncolor ColorLowerSTO = clrBlue ; // ЦВЕТ НИЖНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ STOCHASTICexternstring RSI_Params = "-- ПАРАМЕТРЫ RSI --" ; //======================================extern enumYN UseRSI = enNo; // ИСКАТЬ ДИВЕРГЕНЦИИ НА RSI?externint PeriodRSI = 14 ; // ПЕРИОД RSIint periodRSI;
externENUM_APPLIED_PRICE AppledPriceRSI = PRICE_CLOSE ; // ПРИМЕНИТЬ К:externint UpperLevelRSI = 70 ; // ВЕРХНИЙ УРОВЕНЬ RSIint upperLevelRSI; // Верхний уровень RSIexternint LowerLewelRSI = 30 ; // НИЖНИЙ УРОВЕНЬ RSIint lowerLewelRSI; // Нижний уровень RSIexterncolor ColorUpperRSI = clrRed ; // ЦВЕТ ВЕРХНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ RSIexterncolor ColorLowerRSI = clrBlue ; // ЦВЕТ НИЖНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ RSIexternstring MACD_Params = "-- ПАРАМЕТРЫ MACD --" ; //======================================extern enumYN UseMACD = enNo; // ИСКАТЬ ДИВЕРГЕНЦИИ НА MACDextern enumModeLINE ModeLineMACD = enMdMain; // ИСКАТЬ ДИВЕРГЕНЦИИ ПО ЛИНИИ MACD:externint FastEMA_MACD = 12 ; // БЫСТРОЕ EMA MACDint fastEMA_MACD; // Быстрое EMA MACDexternint SlowEMA_MACD = 26 ; // МЕДЛЕННОЕ EMA MACDint slowEMA_MACD; // Медленное EMA MACDexternint PeriodSignalMACD = 9 ; // ПЕРИОД СИГНАЛЬНОЙ SMA MACDint periodSignalMACD; // Период сигнальной SMA MACDexternENUM_APPLIED_PRICE AppledPriceMACD = PRICE_CLOSE ; // ПРИМЕНИТЬ К:externcolor ColorUpperMACD = clrRed ; // ЦВЕТ ВЕРХНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ MACDexterncolor ColorLowerMACD = clrBlue ; // ЦВЕТ НИЖНИХ ЛИНИЙ ДИВЕРГЕНЦИЙ MACD//---//--- ОПОВЕЩЕНИЯexternstring Notifications_Params = "-- ПАРАМЕТРЫ ОПОВЕЩЕНИЙ --" ; //======================================extern enumYN UseAlerts = enYes; // ОПОВЕЩАТЬ В ТЕРМИНАЛЕ О СИГНАЛЕextern enumYN UseMail = enNo; // ОПОВЕЩАТЬ НА E-MAIL О СИГНАЛЕextern enumYN UsePush = enNo; // ОПОВЕЩАТЬ О СИГНАЛЕ НА МОБИЛЬНЫЙ//--- КОНЕЦ ВХОДНЫХ ПАРАМЕТРОВ
Further in it tick, for starters, I want to implement the simplest logic - an arrow appeared on any of the buffers, I open an order ...
voidOnTick ()
{
double ao_sell; // СИГНАЛ ПО АО НА СЕЛЛdouble ao_buy; // СИГНАЛ ПО АО НА БАЙdouble stohastic_sell; //СИГНАЛ ПО СТОХАСТИКУ НА СЕЛ double stohastic_buy; // СИГНАЛ ПО СТОХАСТИКУ НА БАЙ//double iCustom( // string symbol, // имя символа // int timeframe, // таймфрейм // string name, // папка/имя_пользовательского индикатора // ... // список входных параметров индикатора // int mode, // источник данных // int shift // сдвиг //---АО НА СЕЛЛ
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// СИГНАЛ НА НУЛЕВОЙ СВЕЧЕ ИЗ-ЗА ОСОБЕННОСТЕЙ ИНДИКАТОРА
);
//---АО НА БАЙ
ao_buy= 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, // ОПОВЕЩАТЬ О СИГНАЛЕ НА МОБИЛЬНЫЙ 3 , // ТРЕТИЙ БУФЕР- АО БАЙ0// СИГНАЛ НА НУЛЕВОЙ СВЕЧЕ ИЗ-ЗА ОСОБЕННОСТЕЙ ИНДИКАТОРА
);
stohastic_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, // ОПОВЕЩАТЬ О СИГНАЛЕ НА МОБИЛЬНЫЙ 0 , // НУЛЕВОЙ БУФЕР-- СТОХАСТАИК НА СЕЛЛ0// СИГНАЛ НА НУЛЕВОЙ СВЕЧЕ ИЗ-ЗА ОСОБЕННОСТЕЙ ИНДИКАТОРА
);
stohastic_buy = 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, // ОПОВЕЩАТЬ О СИГНАЛЕ НА МОБИЛЬНЫЙ 1 , // ПЕРВЫЙ БУФЕР-- СТОХАСТАИК НА БАЙ0// СИГНАЛ НА НУЛЕВОЙ СВЕЧЕ ИЗ-ЗА ОСОБЕННОСТЕЙ ИНДИКАТОРА
);
if (ao_buy!= EMPTY_VALUE && OrdersTotal ()== 0 )
{
OrderSend ( Symbol (),OP_BUY,lot,Ask,slippages,Bid-sl* Point ,Bid+tp* Point , "ДИВЕРГЕНЦИЯ НА БАЙ ao" ); // ОТКРЫВАЕМ БАЙ ОРДЕР
} else
{
if (ao_sell!= EMPTY_VALUE && OrdersTotal ()== 0 )
{
OrderSend ( Symbol (),OP_SELL,lot,Bid,slippages,Ask+sl* Point ,Ask-tp* Point , "ДИВЕРГЕНЦИЯ НА СЕЛ СТОХАСТИК" ); // ОТКРКЫВВАЕМ СЕЛ ОРДЕР
} else
{
if (stohastic_buy!= EMPTY_VALUE && OrdersTotal ()== 0 )
{
OrderSend ( Symbol (),OP_BUY,lot,Ask,slippages,Bid-sl* Point ,Bid+tp* Point , "ДИВЕРГЕНЦИЯ НА БАЙ ao" ); // ОТКРЫВАЕМ БАЙ ОРДЕР
} else
{
if (stohastic_sell!= EMPTY_VALUE && OrdersTotal ()== 0 )
{
OrderSend ( Symbol (),OP_SELL,lot,Bid,slippages,Ask+sl* Point ,Ask-tp* Point , "ДИВЕРГЕНЦИЯ НА СЕЛ СТОХАСТИК" ); // ОТКРКЫВВАЕМ СЕЛ ОРДЕР
}
}
}
}
To begin with, I declared variables for receiving signals for ao buy and sat, and through the iCustom function I get the value for ao buy from the third buffer and for ao sat from the second . And in the same way I get values for stochastic buy from zero buffer and for the stochastic sat down from the first buffer.
After I have received the values from the buffers into the variables, I check for the presence of an arrow on the chart.
In the strategy tester, it turns out that if I turn on the analysis by AO in the input parameters, then deals are opened - everything is fine ... And if I turn on the analysis by stochastics, then nothing happens - no errors or anything else. Tell me please - what am I doing wrong in getting the value of the indicator buffer or in checking that there is something in it? How to fix my mistake?
Thank you in advance. p / s I immediately answer the possible the question is, why are the comments written in caps - am I sick, should I do this? I am writing because it is convenient for me to watch it because of my first disability. groups after coma at 1.5 months.
To begin with, I declared variables for receiving signals for ao buy and sat, and through the iCustom function I get the value for ao buy from the third buffer and for ao sat from the second . And in the same way I get values for stochastic buy from zero buffer and for the stochastic sat down from the first buffer.
After I have received the values from the buffers into the variables, I check for the presence of an arrow on the chart.
In the strategy tester, it turns out that if I turn on the analysis by AO in the input parameters, then deals are opened - everything is fine ... And if I turn on the analysis by stochastics, then nothing happens - no errors or anything else. Tell me please - what am I doing wrong in getting the value of the indicator buffer or in checking that there is something in it? How to fix my mistake?
Thank you in advance. p / s I immediately answer the possible the question is, why are the comments written in caps - am I sick, should I do this? I am writing because it is convenient for me to watch it because of my first disability. groups after coma at 1.5 months.
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.
What do you mean by"masking format "? As usual, e.g. "*.csv", separately specify the directory to start the search.
Well, "usually" can be different. The standard ones for OS can be extended according to your needs. For example, you can specify date in name in different formats, etc.
Looking for a function to search the directory of a file by mask, the search should go through all subdirectories, the function should return an array with the full path of the file. Please share such a function.
FileFindFirst supports searching by mask. All that remains is to write a recursive function for all subdirectories.
If such a question arises, it means that it is too early to solve such a problem, you need to learn the basics. But now, instead of the evil me, some kind people will come and calmly explain everything.
And I'll just ask - have you looked at what is going on in this method at all?
Well, "usually" can be different. The standard operating system can also be extended to suit your needs. For example the date in the name can be set in different formats, etc.
I don't see the point in making it more complicated.
FileFindFirst
FileFindFirst supports searching by mask. It remains to write a recursive function for all subdirectories.
I know the theory, thank you.
Good afternoon everyone. I'm trying to write an adviser on a custom indicator.
On the chart, he draws arrows like this
The indicator has so many settings. First part.
and the second part of the settings
The indicator looks for divergences based on one of the 4 classic indicators - ao, stochastic, rsi, macd .
The peculiarity of the indicator is that it draws a signal arrow when the candle opens, that is at zero bar and while the candle is being formed, the arrow hangs, and after the candle is closed, it is not redrawn.
The indicator has 8 buffers. Because 8 arrows can be drawn - 4 for sale for each of the standard indicators and 4 for purchase.
It looks like this in the data window:
Like me I understand the zero buffer is the arrow on the stochastics on the villages. The first buffer is an arrow on the stochastic for a buy. The second buffer arrow on the ao sat down. The third buffer is an ao to buy arrow. The fourth buffer is an arrow on rsi to sit down. The fifth is the rsi arrow for buy. The sixth is the MACD arrow to the village And the seventh buffer is the MACD arrow for a buy.
I transferred all the input parameters of the indicator to the EA:
Further in it tick, for starters, I want to implement the simplest logic - an arrow appeared on any of the buffers, I open an order ...
To begin with, I declared variables for receiving signals for ao buy and sat, and through the iCustom function I get the value for ao buy from the third buffer and for ao sat from the second . And in the same way I get values for stochastic buy from zero buffer and for the stochastic sat down from the first buffer.
After I have received the values from the buffers into the variables, I check for the presence of an arrow on the chart.
In the strategy tester, it turns out that if I turn on the analysis by AO in the input parameters, then deals are opened - everything is fine ... And if I turn on the analysis by stochastics, then nothing happens - no errors or anything else. Tell me please - what am I doing wrong in getting the value of the indicator buffer or in checking that there is something in it? How to fix my mistake?
Thank you in advance. p / s I immediately answer the possible the question is, why are the comments written in caps - am I sick, should I do this? I am writing because it is convenient for me to watch it because of my first disability. groups after coma at 1.5 months.
To begin with, I declared variables for receiving signals for ao buy and sat, and through the iCustom function I get the value for ao buy from the third buffer and for ao sat from the second . And in the same way I get values for stochastic buy from zero buffer and for the stochastic sat down from the first buffer.
After I have received the values from the buffers into the variables, I check for the presence of an arrow on the chart.
In the strategy tester, it turns out that if I turn on the analysis by AO in the input parameters, then deals are opened - everything is fine ... And if I turn on the analysis by stochastics, then nothing happens - no errors or anything else. Tell me please - what am I doing wrong in getting the value of the indicator buffer or in checking that there is something in it? How to fix my mistake?
Thank you in advance. p / s I immediately answer the possible the question is, why are the comments written in caps - am I sick, should I do this? I am writing because it is convenient for me to watch it because of my first disability. groups after coma at 1.5 months.
There are a lot of unnecessary brackets in the code to begin with
and to see what the problem is without reading the code, you need to run the EA in the tester
Stupid. 132 bars. I have 6 values on each bar. How do I write it as an array? I don't want to use a structure.)
Uh...
what?