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

MQL5 エキスパート

仕事が完了した

実行時間14 分

指定

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)


応答済み

1
開発者 1
評価
(414)
プロジェクト
478
40%
仲裁
7
43% / 29%
期限切れ
16
3%
2
開発者 2
評価
(229)
プロジェクト
339
49%
仲裁
21
5% / 33%
期限切れ
24
7%
3
開発者 3
評価
(2077)
プロジェクト
2636
61%
仲裁
113
45% / 26%
期限切れ
418
16%
仕事中
4
開発者 4
評価
(590)
プロジェクト
789
71%
仲裁
9
33% / 33%
期限切れ
22
3%
5
開発者 5
評価
(23)
プロジェクト
53
9%
仲裁
10
20% / 60%
期限切れ
11
21%
6
開発者 6
評価
(355)
プロジェクト
589
70%
仲裁
14
43% / 7%
期限切れ
28
5%
7
開発者 7
評価
(24)
プロジェクト
34
9%
仲裁
3
33% / 0%
期限切れ
8
24%
8
開発者 8
評価
(414)
プロジェクト
670
33%
仲裁
60
17% / 32%
期限切れ
113
17%
仕事中
9
開発者 9
評価
(53)
プロジェクト
79
18%
仲裁
13
15% / 54%
期限切れ
5
6%
10
開発者 10
評価
(320)
プロジェクト
521
66%
仲裁
52
21% / 38%
期限切れ
165
32%
仕事中
11
開発者 11
評価
(439)
プロジェクト
545
25%
仲裁
21
38% / 38%
期限切れ
83
15%
12
開発者 12
評価
(1127)
プロジェクト
1429
62%
仲裁
21
57% / 10%
期限切れ
43
3%
13
開発者 13
評価
(28)
プロジェクト
36
17%
仲裁
5
20% / 40%
期限切れ
17
47%
14
開発者 14
評価
(97)
プロジェクト
121
25%
仲裁
5
20% / 60%
期限切れ
17
14%
15
開発者 15
評価
(563)
プロジェクト
932
47%
仲裁
301
59% / 25%
期限切れ
124
13%
仕事中
16
開発者 16
評価
(4)
プロジェクト
5
0%
仲裁
3
0% / 67%
期限切れ
2
40%
17
開発者 17
評価
(62)
プロジェクト
140
46%
仲裁
19
42% / 16%
期限切れ
32
23%
18
開発者 18
評価
(46)
プロジェクト
73
16%
仲裁
13
8% / 92%
期限切れ
37
51%
類似した注文
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

プロジェクト情報

予算
30+ USD
VAT(付加価値税) (20%): 6 USD
合計: 36 USD
開発者用
27 USD
締め切り
最高 1 日