EA not taking trades

 

My EA isn't taking trades on demo.  I works in Strategy Tester. 

I've checked the three more obvious culprits, live trading, auto trading, allow automated trading.  

I've tried three different accounts on three different brokers.

It should look like this pic from tester.  The closes you see there are not entirely accurate.  I'm working on that.

Any suggestions?

I

 
Print the important values with Comment on the chart and run the tester in visual mode - or use the debugger with hist. data.
 
Carl Schreiber #:
Print the important values with Comment on the chart and run the tester in visual mode - or use the debugger with hist. data.

"Print the important values with Comment on the chart"  Sorry, I'm not really sure what this means.  Are you saying show the proper entry/exit points on the picture I posted?

Or, edit the mql to add a comment at each price-related decision point?


"and run the tester in visual mode"  yes, it's easy to see that entries and exits are missed.

"or use the debugger with hist. data"  any chance you can give me some guidance on how to do this?

 
If you have access to the source code , put some print statements at the moment of the trade to make sure that you are getting there. Other issue could be lot size or account restrictions. A screenshot of the experts tab could be really helpful.  
 
Juan Pablo Castro Forero #:
If you have access to the source code , put some print statements at the moment of the trade to make sure that you are getting there. Other issue could be lot size or account restrictions. A screenshot of the experts tab could be really helpful.  

In the log file there is no indication that trade was even attempted.

These are valid entries according to the rules.  Trades are at least executed in tester.


Files:
20240926.log  7 kb
 
rippin #:

In the log file there is no indication that trade was even attempted.

These are valid entries according to the rules.  Trades are at least executed in tester.


Juan, please see dm.  thanks.

 
1. Check Logs: Look at the "Experts" and "Journal" tabs for any error messages.
2. Broker Restrictions: Some demo accounts have limitations; check your broker’s rules.
3. OrderSend Conditions: Use `GetLastError()` to check for errors like lot size or slippage issues.
4. Magic Number: Ensure the EA’s magic number is unique.
5. Time Filters: Verify that the EA’s trading time conditions are being met.
6. Demo vs Tester Differences: Spreads, slippage, or tick data might differ between demo and Strategy Tester.
7. Lot Size: Check the broker’s allowed lot size limits.
8. Print Debug Logs: Add `Print()` statements for key variables to troubleshoot.