Find current and previous touch

Техническое задание

Hi everyone,

I need to store 2 data from a cross of 2 ema, each signal is generated by this and similar(there are 11 emas):  

TouchTime=TimeCurrent();

if(ema1[1] > ema2[1] && ema1[0]< ema2[0]) 
          {
           if(TouchTime != emacross1_TouchTime) 
           { 
           emacross1_TouchTime= TouchTime;
           }        
          }

if(ema2[1] > ema3[1] && ema2[0]< ema3[0]) 
          {...

and I would like to store the current and previous signal of this array:

int touchedline[10];
int temp = 0;
int valuearray = 0;

touchedline[0]=emacross1_TouchTime;
touchedline[1]=emacross2_TouchTime;
touchedline[2]=emacross3_TouchTime;
touchedline[3]=emacross4_TouchTime;
touchedline[4]=emacross5_TouchTime;
touchedline[5]=emacross6_TouchTime;
touchedline[6]=emacross7_TouchTime;
touchedline[7]=emacross8_TouchTime;
touchedline[8]=emacross9_TouchTime;
touchedline[9]=emacross10_TouchTime;

 I tried with this loop, but on tick mode when multiple signal are generated on the same bar it doesn't work correctly (as you can see from the picture attached):

 

int highest=-1, previoushighest=-1;

for(int i=0;i<10;i++)
     {
      if(touchedline[i]>temp)
        {
         highest=i;
         temp=touchedline[i];
        }
     }
   temp=0;
   for(int i=0;i<10;i++)
     {
      if(touchedline[i]>temp && i!=highest)
        {
         previoushighest=i;
         temp=touchedline[i];
        }
     }
   Print("act_highest :",highest);
   Print("prv_highest :",previoushighest);

Файлы:

PNG
mecca_ea.png
46.6 Kb
MQ5
mecca_ea.mq5
12.6 Kb

Откликнулись

1
Разработчик 1
Оценка
(508)
Проекты
764
63%
Арбитраж
33
27% / 45%
Просрочено
23
3%
Свободен
2
Разработчик 2
Оценка
Проекты
0
0%
Арбитраж
2
0% / 100%
Просрочено
0
Свободен
3
Разработчик 3
Оценка
(13)
Проекты
20
30%
Арбитраж
5
20% / 80%
Просрочено
5
25%
Свободен
4
Разработчик 4
Оценка
(8)
Проекты
10
40%
Арбитраж
7
14% / 86%
Просрочено
4
40%
Свободен
5
Разработчик 5
Оценка
(20)
Проекты
46
54%
Арбитраж
3
67% / 0%
Просрочено
14
30%
Свободен
Похожие заказы
I NEED TO HAVE MY INDICATOR CONVERTED TO PINESCRIPT. IF YOU CHARGE PER LINES PLEASE ADVISE ALSO I NEED THIS DONE QUICKLY. IF YOU ARE ABLE FINISH WITHIN A DAY OR 2 PLEASE APPLY. THE INDICATOR IS BASED OFF ZIG ZAG AND RSI
I'm looking for a website developer that can create a registration form with email and username. This information will be part of a license key on indicators and EAs sold on that website. However there will be a new job created for this stage. For now I just need a registration box with email and user name to be input by the user. A list or database of this information to be created. There should also be a help chat
Hi I want you to make software, let's give the software a name " rocky", I want to explain the project to understand the possibility, example: let's assume I have a computer and there is some internet browsers open, now the software "rocky" you will make is monitoring the computers full screen or a region of screen continuesly and as soon as the internet browser updates with some graphical changes (which is the text
Position: Telegram Bonk Bot Type Developer Budget: $150 Start Date: Immediate Project Overview: We are seeking an experienced and skilled Telegram Bot Developer to complete and launch an advanced TG BOT Notification and Automated Trading Bot. This bot is designed to provide real-time notifications about new token info and execute automated trades based on user-defined preferences. 😁 The core functionality and

Информация о проекте

Бюджет
10- USD
Сроки выполнения
от 1 до 3 дн.