Convert ADX EA from MQL4 to MQL5 - 20 lines of code only

MQL5 Experten

Auftrag beendet

Ausführungszeit 14 Minuten

Spezifikation

Convert this simple lines of MQL4 Code to a MQL5 Expert Advisor:

input int  TakeProfit=3900;//Take profit
input int  StopLoss=500;//Stop Loss

input int MAGIC = 2930;
input double defaultLot = 0.01;
input int period = 13;
input ENUM_APPLIED_PRICE appliedPrice = PRICE_CLOSE;
input int shift = 0;
input int limitUp = 40;

void OnTick()
  {   
   double adx_main = iADX(NULL, 0, period, appliedPrice, MODE_MAIN, shift);
   double adx_plusdi = iADX(NULL, 0, period, appliedPrice, MODE_PLUSDI, shift);
   double adx_minusdi = iADX(NULL, 0, period, appliedPrice, MODE_MINUSDI, shift);
   
   if(countOrders(MAGIC) == 0) {
      if(adx_main > limitUp) {
         double lot = defaultLot;
         if(adx_plusdi > adx_minusdi) {
            Print("Open SELL Lot:"+DoubleToStr(lot)+" - SL:"+IntegerToString(StopLoss)+" -TP:"+IntegerToString(TakeProfit));
            sell(lot, StopLoss, TakeProfit, MAGIC, "");
         } else if(adx_plusdi < adx_minusdi) {
            Print("Open BUY Lot:"+DoubleToStr(lot)+" - SL:"+IntegerToString(StopLoss)+" -TP:"+IntegerToString(TakeProfit));
            buy(lot, StopLoss, TakeProfit, MAGIC, "");
         }
      }
   }

}

Some functions are not included:

- "countOrders" will return the number of executed orders for this specific MAGIC number

- "sell"/"buy" will open a sell/buy order with the specified parameters

So basically, the EA will open an order if there no order already opened, and if:

- the ADX Plus DI is above the ADX Minus DI (sell)

- the ADX Plus DI is below the ADX Minus DI (buy)


Bewerbungen

1
Entwickler 1
Bewertung
(414)
Projekte
478
40%
Schlichtung
7
43% / 29%
Frist nicht eingehalten
16
3%
Frei
2
Entwickler 2
Bewertung
(229)
Projekte
339
49%
Schlichtung
21
5% / 33%
Frist nicht eingehalten
24
7%
Frei
3
Entwickler 3
Bewertung
(2077)
Projekte
2636
61%
Schlichtung
113
45% / 26%
Frist nicht eingehalten
418
16%
Arbeitet
4
Entwickler 4
Bewertung
(590)
Projekte
789
71%
Schlichtung
9
33% / 33%
Frist nicht eingehalten
22
3%
Frei
5
Entwickler 5
Bewertung
(23)
Projekte
53
9%
Schlichtung
10
20% / 60%
Frist nicht eingehalten
11
21%
Frei
6
Entwickler 6
Bewertung
(355)
Projekte
589
70%
Schlichtung
14
43% / 7%
Frist nicht eingehalten
28
5%
Frei
7
Entwickler 7
Bewertung
(24)
Projekte
34
9%
Schlichtung
3
33% / 0%
Frist nicht eingehalten
8
24%
Frei
8
Entwickler 8
Bewertung
(414)
Projekte
670
33%
Schlichtung
60
17% / 32%
Frist nicht eingehalten
113
17%
Arbeitet
9
Entwickler 9
Bewertung
(53)
Projekte
79
18%
Schlichtung
13
15% / 54%
Frist nicht eingehalten
5
6%
Frei
10
Entwickler 10
Bewertung
(320)
Projekte
521
66%
Schlichtung
52
21% / 38%
Frist nicht eingehalten
165
32%
Arbeitet
11
Entwickler 11
Bewertung
(439)
Projekte
545
25%
Schlichtung
21
38% / 38%
Frist nicht eingehalten
83
15%
Frei
12
Entwickler 12
Bewertung
(1127)
Projekte
1429
62%
Schlichtung
21
57% / 10%
Frist nicht eingehalten
43
3%
Frei
13
Entwickler 13
Bewertung
(28)
Projekte
36
17%
Schlichtung
5
20% / 40%
Frist nicht eingehalten
17
47%
Frei
14
Entwickler 14
Bewertung
(97)
Projekte
121
25%
Schlichtung
5
20% / 60%
Frist nicht eingehalten
17
14%
Frei
15
Entwickler 15
Bewertung
(563)
Projekte
932
47%
Schlichtung
301
59% / 25%
Frist nicht eingehalten
124
13%
Arbeitet
16
Entwickler 16
Bewertung
(4)
Projekte
5
0%
Schlichtung
3
0% / 67%
Frist nicht eingehalten
2
40%
Frei
17
Entwickler 17
Bewertung
(62)
Projekte
140
46%
Schlichtung
19
42% / 16%
Frist nicht eingehalten
32
23%
Frei
18
Entwickler 18
Bewertung
(46)
Projekte
73
16%
Schlichtung
13
8% / 92%
Frist nicht eingehalten
37
51%
Frei
Ähnliche Aufträge
The Expert Advisor would use two built-in indicators as entry/exit signals and our own risk management strategy with customizable inputs. The goal is to create a reliable and efficient trading tool that can automate our trading process on the MT5 platform
Hi, I have an indicator from my friend, I want to copy it to my own MT5 can you do that for me. Here is the link
I'm looking for someone to help me create an arbitrage trading robot that can trade on any decentralized exchange and forex market. I already have some source code to a strategy but would like to enhance it to make it profitable and automated
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
Hello Every one, Good day, I want from someone professional to create an EA is working on Mt5, This EA is working by depend on some indicators, and all those indicators must be working on MACD window, not on the chart, for more details please read my attached pdf file carefully. Many Thanks
I'm looking for an expert MQL5 developer that can create an EA that's based on my price action trading strategy with no indicators. The EA must analyze trades based on my price action rules, enter trades based on my price action rules, manage trades based on my price action rules and exit trades based on my price action rules
hi hi there i have an strategy on tradingview and i want to automate it like metatrader EA so i want the strategy to open and close trade automaticlly on tradingview
We are looking for an experienced Expert Advisor Developer who can build a customized MT5 Expert Advisor for us. The Expert Advisor would use two built-in indicators as entry/exit signals and our own risk management strategy with customizable inputs. The goal is to create a reliable and efficient trading tool that can automate our trading process on the MT5 platform. Skills required: - Strong understanding of
I need stochastic div (hidden &regular ea) that should perform task in all tf's ..divergence is a repaint stly so i want to use it with candlestick flips .. so bet for it

Projektdetails

Budget
30+ USD
MwSt (20%): 6 USD
Insgesamt: 36 USD
Für die Entwickler
27 USD
Ausführungsfristen
bis 1 Tag(e)