The famous Moving Average Convergence Divergence (MACD) Strategy is modified to be compatible with PineConnector to enable trading automation. We added a 20-period Exponential Moving Average (EMA20) to the trend-following strategy to filter out counter-trend positions. The MACD strategy can be used for forex trading, stock trading, futures trading, crypto trading and trading of other instruments – also, ideal if you are day trading or swing trading.
Nevertheless, we recommend that paper trading should be done first, before running on your live trading accounts.
After setting up this MACD crossover pine script,
- an alert will automatically trigger when conditions are met (as per the blue PineConnector arrows)
- the PineConnector EA will process the alert message
- the appropriate order or action will be executed automatically on your MT4/5 terminal
Looking to automate your trading?
PineConnector is a user-friendly bridge that enables retail traders to auto-execute TradingView alerts on MT4 & MT5 without fancy coding. Try PineConnector for 7 days – credit card not required →
Create a PineScript and attach the code below
|
|
Edit the highlighted portion of the code to your preassigned ID found in the PineConnector members area (e.g. 60123456789) |
|
Save the code, and click "Add to Chart" | |
Guide to create alerts: Create alerts |
Volume Type: Percentage of account balance ● Assuming risk=1 and $1000 account, the EA will compute the position size whereby when the trade hits SL, you will lose 1% or $10. |
|
Close on reverse: TRUE ● Then open buy position will be closed first followed by the open of a sell, upon receipt of a sell signal - and vice versa |