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
(508)
Progetti
764
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
Hi I need access to Pocket option OTC charts where I can apply my tradingview indicator. I have the indicator but I need access to OTC charts to apply them! Please help
Tenho um endereço de API que retorna informações, a cada 1 minuto faremos uma consulta e mostraremos em um painel, é necessário validar se todos os tempos gráficos retornaram, em alguns momentos pode não retornar todos os dados. https://integra.tasdigital.com.br/GetIndicadoresForexDataAtualProducao/XAUUSD
Hi, Do you have an indicator or expert and would like to protect and control it? What you will get protection and control Customer control panel The number of products is unlimited. You can add any number of your own experts and consultations You can give a trial period for your product, for example a week or a month, after which the customer subscribes Monthly, annually, or for life, depending on the customer’s
I need an EA to automate Tradingview alerts on MT4 using webhook alerts. The bridge/connector should be python based GUI. Required features at a minimum Mapping Tradingview alert formats to MT4 Automating market, limit and stop orders with entry price, stop loss, multiple TPs and trailing stop Lot sizing - fixed/% of balance/fixed amount breakeven, partial close and trailing stop Mapping pair name prefixes/suffixes
Hello, I am looking for an experienced and professional developer to create a trade copier that transfers trades from MetaTrader 5 (MT5) to NinjaTrader 8 (NT8). I am looking for a developer with a strong track record in creating MT5 to NT8 trade copiers and who can deliver a robust and reliable solution. Thank you, and I look forward to your proposals
Hi there ,I am seeking for some who can I integrate MT4+MT5 into Matlab!We need our indicator window of MT4+MT5 viewable in Matlab so we can execute more research on Matlab Best regards Richie
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 want to find a Developer to perform this work and settle payments in this Application. I undertake not to communicate with Applicants anywhere else except this Application, including third-party messengers, personal correspondence or emails. I understand that violators will be banned from publishing Orders in the Freelance service. I have read the Rules of using the Freelance service and accept them. I agree
I am working on a python code that uses mt5 package and I am facing issues in connecting to a platform. In particular, this same issue occurs occasionally without me changing the code / mt5 settings, I cannot individuate any particular reason to this intermitting behaviour. Network is stable. My code is of the kind: mt5.initialize() mt5.login(login=login, password=password, server=server) I also tried variations of

Informazioni sul progetto

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