-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. I have moved this thread. -
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010)
-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. I have moved this thread. -
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I have developed an EA accordng to this logic.
Moving Averages (MA50 and MA200), RSI,MACD, Parabolic SAR, ATR,Volume
Strategy Details
Day Trading Strategy
Buy Signal:
The 50-period moving average (MA50) crosses above the 200-period moving average (MA200) (Golden Cross), indicating a potential upward trend.
RSI is below 30, indicating that the asset might be oversold.
The current volume is greater than the average volume, confirming the strength of the price movement.
Sell Signal:
The 50-period moving average (MA50) crosses below the 200-period moving average (MA200) (Death Cross), indicating a potential downward trend.
RSI is above 70, indicating that the asset might be overbought.
The current volume is greater than the average volume, confirming the strength of the price movement.
Long-Term Trading Strategy
Buy Signal:
The MACD line crosses above the MACD signal line, indicating a potential upward momentum.
The price is above both the 50-day moving average (MA50) and the 200-day moving average (MA200), confirming an upward trend.
The Parabolic SAR is below the price, indicating an upward trend.
Sell Signal:
The MACD line crosses below the MACD signal line, indicating a potential downward momentum.
The price is below both the 50-day moving average (MA50) and the 200-day moving average (MA200), confirming a downward trend.
The Parabolic SAR is above the price, indicating a downward trend.
Risk Management: Stop-Loss and Take-Profit Levels
Stop-Loss Level: Set at a price equal to the current price minus 1.5 times the ATR.
Take-Profit Level: Set at a price equal to the current price plus 1.5 times the ATR.
Implementation Steps
Calculate Indicators:
Calculate MA50, MA200, RSI, MACD, Parabolic SAR, ATR, and average volume.
Generate buy and sell signals for both day trading and long-term trading strategies based on the conditions described above.
Calculate stop-loss and take-profit levels using the ATR.
Issues,
its not opening trades as per instructions (short term and long term), its not not working on multi charts or multi TFs.
Also i would require if some one can guide how to code martingale and traling stop functions.
Appreciate if someone can guide.