Find current and previous touch

MQL5 エキスパート 統合

指定

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
評価
(512)
プロジェクト
772
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%
類似した注文
Im looking for an Modern UI/Dashboard for my MT5 Advisor. Please only apply with examplers of work that you have done before. Im looking for: Daily DD Overall DD News (upcoming) Open lots Traded lots overall Profit daily Profit overall
im looking for coder that can code high/lows on a range and is defined by 3candle formation on the higher timeframe and a bos/mss on the lower timeframe.it should be able to show the near by liquidity of the poi on that range. is may eventually become a EA after
Hi Teams Looking for trading strategy or an EA, which can trigger trade, in XAUUSD, With fixed SL of 2 USD AND TP OF 3 TO 5 USD. Any strategy any time frames. Can work on lowest size
Build Very Simple Grid EA based on Custom Grid Funcation. Alternative Buy Sell 1st Trade buy 2 sell 3 buy 4 Sell. Set Buy lot and Sell lot parameter. Max Grid Set and Max open Trade
MQL5 Expert Advisor Development for Custom Method I need a skilled MQL5 programmer to develop an Expert Advisor (EA) for the MetaTrader 5 platform. This EA should be tailored to a unique trading strategy we've created, specifically for the m1 time frame. Key Requirements: - The EA must incorporate features specific to our trading method. - It should utilize the ATR and Fibonacci indicators/signals. Ideal Skills and
Hello there, MQL5 Expert Advisor Development for Custom Method I need a skilled MQL5 programmer to develop an Expert Advisor (EA) for the MetaTrader 5 platform. This EA should be tailored to a unique trading strategy we've created, specifically for the m1 time frame. Key Requirements: - The EA must incorporate features specific to our trading method. - It should utilize the ATR and Fibonacci indicators/signals. Ideal
I have a strategy on Tradingview and I need to execute it on Tradovate platform. Can you help me to setup a server? And respond to this if you have done similar projects before
Need an expert to create and design an EA forex expert advisor for MeTatRADER 4, You have to be well skilled and experienced in understanding trading specifications while discussing coding forex trading robots if not don't reach out please
I am looking for a skilled Thinkorswim script developer for a one-time project. Your task will be to combine 8 distinct Thinkorswim studies (I will provide the code for each) into one Lower Study. The final script should display histogram rows for the individual studies with a bubble color scheme of bright green, dark green, gray, dark red, and bright red
Hello I would like to convert my PineScript into a MQL5 EA. It's a pine indicator but I would like to create later on a strategy based on this. It's about drawing 3 Boxes (Sessions with time inputs) and pivot highs and pivot lows in a timeframe which the user can choose (input for pivot high/low timeframe). The pivot highs and lows can get improved with 3 indicators: - RSI - Stoch - MACD - ADX That means you must add

プロジェクト情報

予算
10- USD
締め切り
最低 1 最高 3 日