orders not executed in real

 
Hi,
given that I am using a broker where the ability to place orders via an EA is enabled. I use the ordersend function followed by ordermodify, which handles errors inside the EA and there are no errors in the diary.

If I run the EA in test opens positions, while in real no.
Example: On the day you do not open positions, the next day performing the test on that day opens positions.

What may be due?
 
Creative Studio:
Hi,
given that I am using a broker where the ability to place orders via an EA is enabled. I use the ordersend function followed by ordermodify, which handles errors inside the EA and there are no errors in the diary.

If I run the EA in test opens positions, while in real no.
Example: On the day you do not open positions, the next day performing the test on that day opens positions.

What may be due?

The EA may be coded to only work in the tester, many demo versions are. Contact the owner of the EA or buy the non-demo version.

 
I wrote the EA. There are no account checks for operation only in demo or in real mode only
 
Creative Studio:
I wrote the EA. There are no account checks for operation only in demo or in real mode only

If you wrote the EA, then include error reports if an ordersend fails.

There must be a reason and it must be in your code.

 
Orders errors are managed and are not reported, which means that it does not arrive at the ordersend. At this point for 2 possible cases.
1 - Conditions not respected for entry
2 - Case excluded. Which returns errors.

Excluding the second case remains the first. So I wonder. If in testing the conditions are respected and visually also live because it does not arrive at the order send?
 

I have never had an EA work correctly in the tester but not on a real time chart.

There is a reason, but we are unable to guess what it is.

 
I'm zero of solutions. I asked the broker if maybe he encountered similar problems but he still did not give me an answer. It's something out of the ordinary
 
Creative Studio:
I'm zero of solutions. I asked the broker if maybe he encountered similar problems but he still did not give me an answer. It's something out of the ordinary

I doubt that it is anything out of the ordinary. It can be frustrating when you can't find a solution, but it is always something in the code and it is normally something so ridiculous that you will kick yourself when you do find it.

 
I double checked the code, but there are no real or demo references. There are only checks of moving averages.

By the way, I would like to raise a question about this.
I use indicators built on other indicators and to do so I use the functions available on mql4 as iMAOnArray, iRSIOnArray and iBandsOnArray.

The values returned by the EA differ from those in the graphic window.

The moving averages are calculated with the following buffer:
    SizeBufferStocRed = (3.45 * (iMaExpStoRedPeriod + 1)) + 2;
and on it I calculate the rest .....

I get almost identical values but I wondered if we could get the same result on the indicator chart
 
Creative Studio:
Orders errors are managed and are not reported, which means that it does not arrive at the ordersend. At this point for 2 possible cases.
1 - Conditions not respected for entry
2 - Case excluded. Which returns errors.

Excluding the second case remains the first. So I wonder. If in testing the conditions are respected and visually also live because it does not arrive at the order send?

If it does not produce normal errors in MetaTrader's logs then there is obviously a logic problem in your code.

So add a lot of debugging code (printing to log, or outputting to your own files) at every step of the logic so you can find the problem.

That is how we all do it when we are trying to find a logic bug in our code.

 
Obviously, even during the very long debugging phase I have printed everything to get out of the problem. But here I do not understand what I should check because in testing everything works without problems. How do I figure out where the problem comes from?
Reason: