Find current and previous touch

MQL5 Esperti Integrazione

Specifiche

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);

File:

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

Con risposta

1
Sviluppatore 1
Valutazioni
(507)
Progetti
762
63%
Arbitraggio
33
27% / 45%
In ritardo
23
3%
Gratuito
2
Sviluppatore 2
Valutazioni
Progetti
0
0%
Arbitraggio
2
0% / 100%
In ritardo
0
Gratuito
3
Sviluppatore 3
Valutazioni
(13)
Progetti
20
30%
Arbitraggio
5
20% / 80%
In ritardo
5
25%
Gratuito
4
Sviluppatore 4
Valutazioni
(8)
Progetti
10
40%
Arbitraggio
7
14% / 86%
In ritardo
4
40%
Gratuito
5
Sviluppatore 5
Valutazioni
(20)
Progetti
46
54%
Arbitraggio
3
67% / 0%
In ritardo
14
30%
Gratuito
Ordini simili
I need an EA to use for the Supertrend strategy I use in Tradingview. The Supertrend indicator generates buy and sell signals by following the trend. According to the buy signal from the indicator, it will buy in a certain lot amount / a certain percentage of the balance amount and then close the buy position with the sell signal and open a sell order. In general, it is my preference to work with signals from
hi uhm im look for someone who can make me an indicator , which is able to show the entry and exit point and also to show stop lose and take profit . nass 100 , us30 an Ger40 and all currencies the time frame it should use 15 min and it should be scalping . the name of the indicator should be called Pro Da Trader please who ever can do that please contact ne via whats app 0715240554 or my email
Objective: Our objective is to develop a platform that simplifies the analysis and presentation of trading ideas sourced from various channels. This platform will act as a centralized hub for traders to efficiently access and evaluate trading signals. Current Situation: We are actively engaged with multiple trading signal channels, VIP groups on Telegram, and applications. However, we face challenges due to private
TrendingView Indicator 30 - 100 USD
i have an indicator that is 70% complete and I want to make some modifications and additions to it im looking for a developer that have knowlodge of pinescript for tradingview lets discuss more on message
solve errors and debug my existing code to convert it into mq5 The task will be done remotely by anydesk More details will be given privately to better understand the task, already spoken previously by the developer

Informazioni sul progetto

Budget
10- USD
Scadenze
da 1 a 3 giorno(i)