I want the indicator to count the upward movement in the range of 50 bars on the whole chart, i.e. there is a new bar, the last one is excluded for searching and so on with each new bar. So far I have managed to calculate the entire history. In short, I'm stuck with it. May anyone suggest how to solve this problem? I can't use smoothing by type of sliding bars.
#property indicator_separate_window#property indicator_buffers 1#property indicator_color1 Red//--- buffersdouble ExtMapBuffer1[];
externint p=50;//желаемый диапазон баров для поиска double val_plus[];
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
IndicatorDigits(Digits+1);
return(0);
}
//+------------------------------------------------------------------+//| Custom indicator deinitialization function |//+------------------------------------------------------------------+int deinit()
{
return(0);
}
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+int start()
{
int counted_bars=IndicatorCounted(),i,limit,indicator_plus;
double ma1, ma2;
if(counted_bars>0)
counted_bars--;
limit=Bars-counted_bars-1;
for(i=limit;i>=0;i--)
{
ma2=iMA(NULL,PERIOD_CURRENT,21,0,MODE_EMA,PRICE_CLOSE,i+2);
ma1=iMA(NULL,PERIOD_CURRENT,21,0,MODE_EMA,PRICE_CLOSE,i+1);
ArrayInitialize(val_plus,0);
for(int k=p;k>=0;k--)//в этом цикле ищем и суммируем все растущия движения машки
{
ArrayResize(val_plus,p);
if(ma1 > ma2){val_plus[k]=1;}//получили одно растущее движение if(val_plus[k] > 0){indicator_plus=indicator_plus+val_plus[k];}//прибавили его к общей сумме
}
ExtMapBuffer1[i]=indicator_plus;
}
return(0);
}
//+------------------------------------------------------------------+
001: Another question. I can't figure out how to get, with minimal effort, a variable of int type from Time[0] as 00:00. I can't think of anything except for string, StrToTime, and TimeToStr conversions. Thank you!
The indicator should calculate the upward movement in the range of 50 bars on the whole chart, i.e. there is a new bar, the last one is excluded for searching and so on with each new bar. So far I have managed to calculate the entire history. In short, I'm stuck with it. May anyone suggest how to solve this problem? I can't use smoothing by type of sliding bars.
There is the SetIndexDrawBegin() function. But it has a special feature - it counts from left to right. In general, set yourself line SetIndexDrawBegin(0, Bars-p) in Init, and see if this is what you need.
Is it possible to download charts for technical analysis, - indexes S & P 500 Futures Chart, TA 25 Chart, and the S & P 500 Chart if possible can prompt how to do this, maybe there is an explanation of how to download!
I can't find such a broker, can you advise a program for technical analysis, which allows me to download the indexes I'm interested in (can be in real time) or a broker.
Maybe there is an opportunity to download these indices MT-4 or MT-5. I'm just beginning to try to do technical analysis, I would very much like to hear expert advice on how to cope with my task.
Can anyone suggest, install the plugin GetTickerHistory in MT-4, runs, but the download does not go, on Windows 7 x64, is it possible to download the external indexes in another way.
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.
Colleagues, is there an alternative to Report Manager?
I need to merge large reports for several years, and RM hangs up or just does nothing when I click on merge. There is no problem with small reports.
I want the indicator to count the upward movement in the range of 50 bars on the whole chart, i.e. there is a new bar, the last one is excluded for searching and so on with each new bar. So far I have managed to calculate the entire history. In short, I'm stuck with it. May anyone suggest how to solve this problem? I can't use smoothing by type of sliding bars.
Another question. I can't figure out how to get, with minimal effort, a variable of int type from Time[0] as 00:00. I can't think of anything except for string, StrToTime, and TimeToStr conversions. Thank you!
TimeHour(Time[0]) and TimeMinute(Time[0])
The indicator should calculate the upward movement in the range of 50 bars on the whole chart, i.e. there is a new bar, the last one is excluded for searching and so on with each new bar. So far I have managed to calculate the entire history. In short, I'm stuck with it. May anyone suggest how to solve this problem? I can't use smoothing by type of sliding bars.
There is the SetIndexDrawBegin() function. But it has a special feature - it counts from left to right. In general, set yourself line SetIndexDrawBegin(0, Bars-p) in Init, and see if this is what you need.
Is it possible to download charts for technical analysis, - indexes S & P 500 Futures Chart, TA 25 Chart, and the S & P 500 Chart if possible can prompt how to do this, maybe there is an explanation of how to download!
I can't find such a broker, can you advise a program for technical analysis, which allows me to download the indexes I'm interested in (can be in real time) or a broker.
Maybe there is an opportunity to download these indices MT-4 or MT-5. I'm just beginning to try to do technical analysis, I would very much like to hear expert advice on how to cope with my task.
I am very grateful in advance for your help.TimeHour(Time[0]) and TimeMinute(Time[0])
Thank you!
Position closes, but gives OrderClose error 138 for each position
11:44:49 2000.01.10 07:00 Time+iLowest_old EURUSD,H1: open #1 sell 0.10 EURUSD at 1.02940 ok
11:44:49 2000.01.10 14:00 Time+iLowest_old EURUSD,H1: OrderClose error 138
11:44:49 2000.01.10 14:00 Time+iLowest_old EURUSD,H1: close #1 sell 0.10 EURUSD at 1.02940 at price 1.02230
11:44:49 2000.01.11 07:00 Time+iLowest_old EURUSD,H1: open #2 sell 0.10 EURUSD at 1.02660 ok
11:44:49 2000.01.11 14:00 Time+iLowest_old EURUSD,H1: OrderClose error 138
11:44:49 2000.01.11 14:00 Time+iLowest_old EURUSD,H1: close #2 sell 0.10 EURUSD at 1.02660 at price 1.02890
11:44:49 2000.01.13 07:00 Time+iLowest_old EURUSD,H1: open #3 sell 0.10 EURUSD at 1.02860 ok
11:44:49 2000.01.13 14:00 Time+iLowest_old EURUSD,H1: OrderClose error 138 ,
What could it be? The interesting thing is that everything works in another EA.
Can anyone suggest, install the plugin GetTickerHistory in MT-4, runs, but the download does not go, on Windows 7 x64, is it possible to download the external indexes in another way.
Thanks in advance.