[Archive] Programming in mql4 (free) - page 5

 
IgorM:

I've been working on this for a long time now, but I've been working on this for a long time now. I donot know how to use it automatically, but it may be useful in manual trading.


I do not know yet what to do with it. "On Friday I'm drunk... but on Monday I'm Pickle....":) )) (kAmedy).

// Внешние переменные (оптимизируются)
//

extern int t_trend_period =6; // 1-М1, 2-М5, 3-М15, 4-М30, 5-Н1...-для старшего фильтра, внутри которого работаем
extern int s_trend_period = 5; // PERIOD_M1 1 1 минута
// PERIOD_M5 5 5 минут
// PERIOD_M15 15 15 минут
// PERIOD_M30 30 30 минут
// PERIOD_H1 60 1 час
// PERIOD_H4 240 4 часа
// PERIOD_D1 1440 1 день
// PERIOD_W1 10080 1 неделя
// PERIOD_MN1 43200 1 месяц
// 0 (ноль) 0 Период текущего графика 



//+------------------------------------------------------------------+
//| Старт робота |
//+------------------------------------------------------------------+

int init()
 {

return (0);
 }

//+------------------------------------------------------------------+
//| Завершение работы робота |
//+------------------------------------------------------------------+

int deinit()
 {
return (0);
 }

//+------------------------------------------------------------------+
//| Обработка сигнала |
//+------------------------------------------------------------------+

int start() // -----------------------СТАРТ ЭКСПЕРТА--------------- 
 {


if(Time[0] == prevtime) return(0); //ждем нового бара
 prevtime = Time[0]; //если появился новый бар, включаемся 

if (IsExpertStopped)
 {
Comment("Не удалось инициализировать советник!");
return (0);
 }

if (IsExpertFailed)
 {
Comment("Критическая ошибка! Советник остановлен.");
return (0);
 }



//считаем таймфреймы...

int trend_period=GetPeriod(t_trend_period);
int signal_period=GetPeriod(s_trend_period); 

/ ----------------------------Считаем параметры технических индикаторов:------------------------------------

double MA_1 = iMA(Symbol(),trend_period,Period_MA,0,MODE_EMA,PRICE_TYPICAL,1);

double ADX1_1 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_MAIN,0); 
double ADX1_2 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_MAIN,1);
double ADX_PLUS1_1 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_PLUSDI,0);
double ADX_PLUS1_2 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_PLUSDI,1);
double ADX_MINUS1_1 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_MINUSDI,0);
double ADX_MINUS1_2 = iADX(Symbol(), trend_period, Period_ADX, PRICE_OPEN, MODE_MINUSDI,1);
///.......
///.......
///.......
///.......

//для оптимизации по всем ТФ
int GetPeriod(int period)
 {int periodres;
switch(period)
 {
case 1: periodres=1;break;
case 2: periodres=5;break;
case 3: periodres=15;break;
case 4: periodres=30;break;
case 5: periodres=60;break;
case 6: periodres=240;break;
case 7: periodres=1440;break;
case 8: periodres=10080;break;
default: periodres=1;break;
 }
return(periodres);
 } 



 
vitali_yv:

Pro, Fessio and Anal? Which component is more important for a programmer?


I can't say for sure, but looking at what I write myself, it's the latter!

I am still only in my second month of mothballing.

 
Roman.:


Thank you. "Friday I'm drunk... but Monday I'm Pickle....":) )) (kamedy).

oops, what's this?
 
IgorM:
cp, what is it?

"...but there's a problem in determining the TF to make a forecast on, I don't know how to automate it yet..." - it's about optimizing the time frame.... P.S. I'm not drunk anymore... :-)))
 
Roman.:

"...but there's a problem in determining the TF to make a forecast on, I don't know how to automate it yet..." - it's about optimizing the time frame.... P.S. I'm not drunk anymore... :-)))

Thanks, but the TF is not the first priority, I'm still working on the simultaneous analysis of the Sultanova indicator readings on all online timeframes
 
IgorM:

Thanks, but the TF selection is not the first priority - everything is OK by hand, the task is to simultaneously analyse the Sultanov indicator readings on all online TFs.

In that case, I would like to address the optimization question to the author... :-)))
 

The bullish and bearish trends have a temporary but not constant pattern (on the m15-1n zigzag), if you set orders by time by reading the spread and frequency, overlaying the MA for a larger period, + reversal, doubling the lot and a flat filter for pause,

please don't bump...

 
gerrost:

The bullish and bearish trends have a temporary but not constant pattern (on the m15-1n zigzag), if you set orders by time by reading the spread and frequency, overlaying the MA for a larger period, + reversal, doubling the lot and a flat filter on pause,

please don't bump...


You don't recommend it, but post rez (in the test), if in the subject...
 
gerrost:

Bullish and bearish trends have a temporary but not constant pattern (based on the m15-1n zigzag)

well, this "temporary and not permanent pattern" adds up to correlation multicurrency dependence
 
I've learned from experience that such things don't work. Either you pay to the developer and he makes you different updates of features that you want to put into the EA/indicator, or you do them for free, and when he sees that the Expert Advisor is losing money, he gives up on it and on you.