MACD Sample Expert Advisor

Specification

1. The idea of the trading system is as follows: market entries are performed when MACD's main and signal lines intersect in the current trend direction.

2. Trend is determined based on the Exponential Moving Average with the specified period (InpMATrendPeriod). If the current EMA value is greater than the previous one, the trend is seen as growing (ema_current > ema_previous). Alternatively, if current EMA is below the previous one, the trend is considered to be falling (ema_current< ema_previous).

3. Trading Signals:

  • Buy signal: the main MACD line crosses the signal line upwards (macd_current>signal_current && macd_previous<signal_previous).
  • Sell signal: the main MACD line crosses the signal line downwards (macd_current<signal_current && macd_previous>signal_previous). The below figure shows Buy and Sell cases.

4. Positions are closed at opposite signals: Buy positions are closed at Sell signals, and Sell positions are closed at Buy signals.

5. Positions are opened at the market price, when a new bar emerges. The Expert Advisor is to be tested using Open prices, so there is no need to add functions for disabling operations inside the bar.

6. Additional filters for opening a position:

The absolute value of MACD's main line will be used to filter out weak signals: the signal is only confirmed if this value is greater than open_level (in points). Signal confirmation conditions are as follows:

  • Confirmation of a buy signal: Abs(macd_current)>open_level
  • Confirmation of a sell signal: macd_current>open_level

7. Additional filters for closing a position:

The absolute value of MACD's main line will also be used to confirm position closure: the signal is confirmed if this value is greater than close_level (in points). Close signal confirmation conditions are as follows:

  • Confirmation to close Buy positions — macd_current>close_level
  • Confirmation to close Sell positions — Abs(macd_current)>close_level

8. Close by Take Profit — during position opening, a Take Profit level is set at a fixed distance from the open price, specified in points. The value is set in the InpTakeProfit input parameter.

9. Position management

TrailngStop is used to protect profit. Stop Loss is set if profit in points exceeds the value specified in the InpTrailingStop parameter. If the price continues to move in the profit direction, Stop Loss should be trailed at the given distance. Stop Loss cannot be moved towards the loss direction, i.e. the Stop Loss value cannot be increased. If none of protective orders (Take Profit or Stop Loss) triggers, the position should be closed by an opposite signal. No other position exit methods are available.



Responded

1
Developer 1
Rating
(196)
Projects
200
28%
Arbitration
0
Overdue
3
2%
Free
2
Developer 2
Rating
(2)
Projects
2
0%
Arbitration
0
Overdue
0
Free
3
Developer 3
Rating
(79)
Projects
111
37%
Arbitration
0
Overdue
4
4%
Free
4
Developer 4
Rating
(34)
Projects
60
23%
Arbitration
11
73% / 9%
Overdue
3
5%
Free
5
Developer 5
Rating
(236)
Projects
418
34%
Arbitration
52
37% / 40%
Overdue
153
37%
Busy
6
Developer 6
Rating
(294)
Projects
371
21%
Arbitration
43
60% / 23%
Overdue
43
12%
Working
7
Developer 7
Rating
(48)
Projects
62
40%
Arbitration
1
0% / 100%
Overdue
8
13%
Free
8
Developer 8
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
9
Developer 9
Rating
(68)
Projects
77
8%
Arbitration
33
9% / 55%
Overdue
6
8%
Working
10
Developer 10
Rating
(121)
Projects
155
43%
Arbitration
20
60% / 20%
Overdue
8
5%
Working
11
Developer 11
Rating
(568)
Projects
641
41%
Arbitration
21
57% / 29%
Overdue
47
7%
Working
12
Developer 12
Rating
(548)
Projects
1330
59%
Arbitration
28
82% / 0%
Overdue
10
1%
Free
13
Developer 13
Rating
(119)
Projects
169
38%
Arbitration
9
78% / 22%
Overdue
15
9%
Free
14
Developer 14
Rating
(66)
Projects
143
34%
Arbitration
10
10% / 60%
Overdue
26
18%
Free
15
Developer 15
Rating
(563)
Projects
932
47%
Arbitration
301
59% / 25%
Overdue
124
13%
Working
Similar orders
Hi, I need a robot, which wil get instructions to trade in 3 symbols at the same time based on few parameters and calculations. Example: There is 1 symbol called Gold-Near and the rate for it is 1000-1002 If i specify that when the rate reaches 1050, it should sell 1 lot Upon execution it will have to sell 1 lot of cme gold, buy 3 lots of mcx gold and buy currently (lots will be based on calculation). All the
are you aware of the Monday Range Strategy? https://www.youtube.com/watch?v=7B_yBBFx6z8 5pm EST time sunday - monday 5pm est and it has to be on the H1 chart , minimum 1:2 Risk to reward and break even function after 1:1
An EA that executes when the 21 and 55 SMA Cross on certain time frame also the EA will understand supply and demand levels and executes when price reacts on this levels specified and target/stoploss levels will be predetermined...also the robot will also comprise stochastic oscillator
Starting from scratch, I need a solution to develop my own crypto trading and exchange platform. This platform should compare prices across various exchanges like Coinbase, Binance, KuCoin, and Unocoin, as well as different cryptocurrencies. The solution must identify opportunities to buy on one platform and sell on another for a profit, transferring funds to my personal wallet instantly for security. The bot should
Need EA programmer to create an MT4 EA that will be able to leverage trades in favour of the market direction ,the EA should be able to operate to any broker. The EA must trade on a clear trend not when the Market is ranging. More will be explained once your application has been accepted for the job
Hey, great developer I have a thinkorswim script I want to convert it into TradingView. Can you please let me know if you can i will be looking for great developer that will bid for it best regards
Hey, great developer I have a thinkorswim script I want to convert it into TradingView. Can you please let me know if you can i will be looking for great developer that will bid for it best regards
Tradingview developer 30 - 35 USD
Hey greetings. I am in need of tradingview developer that can modify an open source PineScript indicator code to add additional features. Kindly bid for this project if it is what you handle and let proceed with the project
In summary 1) The bot will only take Firm Buy and Firm Sell Signals . 2) The bot will use the SL and TP based on the indicator . 3) the risk to reward is 2:1 but when the price reaches 1:1 set SL to Breakeven 4) the bot will take Firm Buy and Firm sell after the candle closes with a firm buy or firm sell 5) make sure to give an option for number of contracts to be traded . 6) Bot will close all the trades EOD
hi. I hv a strategy on tradingview need to convert to MT4/MT5 expert advisor for algo trading. would like to add some tradingview strategy setting to the EA(not included in my tradingview code): recalculate after order is filled, order size: xx% of equity

Project information

Budget
30+ USD
For the developer
27 USD
Deadline
from 5 to 15 day(s)