[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 466
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Good afternoon. When trying to draw Fibonacci levels on a chart like this:
I get an error 4200 when testing, although initially there are no Fibonacci levels and all old graphic objects are deleted at the beginning of the code when checking the time: What is the problem, no one can explain?double sum=0;
sum+=iMa(NULL, 0, N, 0, MODE_SMA, PRICE_CLOSE, 0); // count the average close price
sum-=iMa(NULL, 0, N, 0, MODE_SMA, PRICE_OPEN, 0); // subtract the average open price sum*=N;
Elegant of course... There was such, unformed, thought. But it doesn't look quite right. MA is still an average of N periods, while I just need the sum. Or am I wrong?
1. Yes
2. What are opening deals? Maybe you don't have a CLOSE condition?
excuse me - buy trades
So the second question remains open:
2) I wrote a fairly simple martingale-based EA, in the tester it works fine, but when I run it on live charts, it only opens buy trades (although today I also opened a sell trade, but still not the same as in the tester)... What is the reason? Why is the EA working fine in the Strategy Tester but poorly on demo charts? The code is exactly the same
to sum it up: may the EA work differently in the Strategy Tester and in real life?
To summarise: can an EA work differently in the tester and in life?
Yes
Elegant of course... I had that thought in my head. But it doesn't seem quite right to me. MA is, after all, the average for N periods, and I just want the sum. Or am I wrong?
If the arithmetic is bad, then you can twist it. But on your own
Hello. I have this question. When using DDE, is it possible to make a query from Excel to the terminal to find out the account status, i.e. ask for "Balance", "Equity" etc. or is it possible to send only quotes via DDE?
Hi. The answer to your question about DDE Query Formats can be found here: https://forum.mql4.com/ru/27755
If your arithmetic isn't good, you can get twisted. But on your own...
sum*=N;
I didn't get it right away, I apologise. I'm tired already before the new year. I'm having a hard time figuring it out. Thank you very much. Happy New Year.
Yes
how's that? Is there any solution to this problem? How am I supposed to check everything on the tester if the tester results leave a lot to be desired?