Bot opening multiple trades when IF function included
- Trade function opening multiple trades instead of one
- Enter Multiple trades and Trailing stop to start at profit
- MQL5: Multi Symbol EA doubled trades
Hi everyone, I have a question, the below function can open 1 sell stop and buy stop when trades number is set at 0. But when I include the function in time and date to open trade at specific time and day of the week, it opens multiple trades what might the issue?
maybe need to increase TradesNumber after stop buystop/sellstop order has been sent?
or add else between those two if's (pending<=Trades_Number)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)