[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 407
![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
Anyway, without RefreshRates() my EAs won't work. I make them looped. Therefore, RefreshRates() is mandatory.
The initial history loading is performed on this principle. Then I periodically recharge it. Otherwise there appear "gaps" in the history with which the Expert Advisor works. I do not know why it happens.
I tried using RefreshRates() for paging. It does not always work.
But RefreshRates() serves to update variables of the market environment, not for paging. Of course, it doesn't swap.
Sometimes only the last bar arrives.
If the chart of an instrument is open, there is always a history for it. There were no errors in this case. The error appeared when the chart of the required instrument was not open.
Hello.
I wanted to ask a question about testing the system. In general, I understand the picture, but since I had no real experience of getting a working EA, but I was creating-creating, testing-testing everything... In general, I do not know when I can stop now.
My Expert Advisor is simple; it has almost no optimization parameters. It is not a scalping one. I traded it on D1 during the period from 2000 to 2013 with one minimum lot 0.01 at $100 depo. This is the report.
Can we trust these results? There are only 300 trades, but according to the strategy logic and D1 timeframe there should not be much more. The strategy has only one optimization parameter - the signal loyalty. If we make the system more strict to them, the parameters will supposedly improve but the amount of deals will only be 175. Can the results be trusted when there are so many trades? Or, is it better to choose the first variant with worse indicators but more trades?
Or both of them are of no use and we need higher mathematical expectation and so on?
on the EUR/USD H4 currency pair is lit " waiting for update " and does not switch to other periods what to do?
If new ticks come during calculations in the Expert Advisor (when the function start() is running), the Expert Advisor will not know about them (ticks). RefreshRates() allows you to use the latest updated prices, but this function does not access the server. It updates the market environment known to the terminal. No function, except for trading, accesses the server.
It's hard to say about the allocated one. You'd have to ask the Metakwots.
I had my real account blocked in MRC because of frequent chart opening and updating. It's not an MQL4 function, but an in-house chart viewer. Maybe, for example, MarketInfo() is accessing the server or only gets part of the data from the market overview.
====================================
As far as I remember the data from Market Watch does not have to be the same as Predefined Variables. Then what and where does RefreshRates() update from?
I have only one answer. Refresh is paging and reconciling the history from the server. I was convinced of this many times when trying to update the history with it. Often only the last bar came. There was a "hole" in the HST file after the terminal was unloaded. But if you open this chart and refresh it, the "hole" was filled. By the way, when RefreshRates() is running in the Task Manager, you can observe the data loading. Perhaps, the reconciliation does not occur when the history is updated with RefreshRates(), but it occurs when the chart is updated.
So, it is necessary to control if you need history without holes in Expert Advisor flow.
1. What do you mean by cyclic? In fact, any Expert Advisor is looped, because it has a start cycle. Once per tick.
2. It seems to me that it's you trading in kitchens, that's why the holes in history are forming. I notice that it happens in lame kitchens. But a quality broker shouldn't have that shit.
But RefreshRates() serves to update variables of the market environment, not for paging. Of course it's not paging.
4. Where does the last bar come?
5. Hmm. Well, if you pull market data through MarketInfo(), as I understand it, there shouldn't be any errors. And if you bypass it, then of course. It looks like this. I haven't checked it yet, but it seems to be the same logic.2. It doesn't depend on a broker. This is a peculiarity of the terminal and its work with the server. For some reason, RefreshRates() does not refresh history like refreshing a chart.
3. Would you read the help already? Here we go again:
Refresh data in predefined variables and time series arrays. This function is used when Expert Advisor or script has been performing calculations for a long time and needs updated data. It returns TRUE if the data is updated, otherwise FALSE. The data may not be updated only because it corresponds to the current state of the client terminal. Expert Advisors and scripts work with their own copy of historical data. The copy of data on the current symbol is created at the first launch of the Expert Advisor or script. At every next launch of the Expert Advisor (remember, the script is executed once and does not depend on incoming ticks), the initially created copy is updated. One or several new ticks can appear while the Expert Advisor or script is running, so the data can get out of date.
4. what are we talking about? Talking about updating the data in the Expert Advisor thread.
5. The EA code above shows how and where the data is updated. If IsRefreshRates is not included, data is updated only in MarketInfo().
Successfully traded on alpari with ilan 2.0 (1.6) with sensible settings, until alerts started coming in about frequent unproductive requests that load up the server for nothing. Turned out that in a fast market alpari increases the minimum possible stop loss setting level to 2 spreads, which corresponded to 40 pips, sometimes less. But my EA seems to set this value in the range of 15-55 pips, which I have understood from reading the code of the EA. But alpari was not satisfied with it and I was threatened with blocking, so I have stopped trading. I didn't really know mql4, I have just edited these lines in the code, which seemed to me the only lines responsible for the problem, it is in the tab of any ilan, near the beginning:
double PrevCl;
double CurrCl;
if (UseTrailingStop) TrailingAlls(TrailStart, TrailStop, AveragePrice);
if ((iCCI(NULL,15,55,0,0)>Drop && ShortTrade)||(iCCI(NULL,15,55,0,0)<(-Drop) && LongTrade)) {
Where I stupidly changed the numbers 15 to 40 to solve the problem, but further I learned from alpari that the problem is not solved, i.e. I did something wrong, which is not surprising. Can you advise me how to edit the EA code correctly so that it puts the stop loss level in the 40-55 pips range instead of 15-55. I know the 40-55 point range is not a big enough for a comfortable stop-loss set and it's too far from the price, which reduces the profit. But I have no choice, I do not want to leave alpari, it is comfortable there. I do not want to leave alpari, it is convenient there.
Hello.
I wanted to ask a question about testing the system. In general, I understand the picture, but since I haven't had any real experience of getting a working EA, I've been creating-creating, testing-testing everything... In general, I do not know when I can stop now.
My Expert Advisor is simple; it has almost no optimization parameters. It is not a scalping one. I traded it on D1 during the period from 2000 to 2013 with one minimum lot 0.01 at $100 depo. This is the report.
Can we trust these results? There are only 300 trades, but according to the strategy logic and D1 timeframe there should not be much more. The strategy has only one optimization parameter - the signal loyalty. If we make the system more strict to them, the parameters will supposedly improve but the amount of deals will only be 175. Can the results be trusted when there are so many trades? Or, is it better to choose the first variant with worse indicators but more trades?
Or both of them are of no use and we need higher mathematical expectation and so on?
Is 10% per year good or bad?
Successfully traded on alpari with ilan 2.0 (1.6) with sensible settings, until alerts started coming in about frequent unproductive requests that load up the server for nothing. Turned out that in a fast market alpari increases the minimum possible stop loss setting level to 2 spreads, which corresponded to 40 pips, sometimes less. But my EA seems to set this value in the range of 15-55 pips, which I have understood from reading the code of the EA. But alpari was not satisfied with it and I was threatened with blocking, so I have stopped trading. I don't really know mql4, I have just edited these lines in the code, which seemed to me the only lines responsible for the problem, it is in the tab of any ilan, near the beginning:
double PrevCl;
double CurrCl;
if (UseTrailingStop) TrailingAlls(TrailStart, TrailStop, AveragePrice);
if ((iCCI(NULL,15,55,0, 0)>Drop && ShortTrade)||(iCCI(NULL,15,55,0,0)<(-Drop) && LongTrade)) {
Where I stupidly changed the numbers 15 to 40 to solve the problem, but further I learned from alpari that the problem is not solved, i.e. I did something wrong, which is not surprising. Can you advise me how to edit the EA code correctly so that it puts the stop loss level in the 40-55 pips range instead of 15-55. I know the 40-55 point range is not a big enough for a comfortable stop-loss set and it's too far from the price, which reduces the profit. But I have no choice, I do not want to leave alpari, it is comfortable there. I do not want to leave alpari, it is convenient there.
So change the stoploss parameters, why are you changing the indicator parameters?
so change the stop loss parameters, why are you changing the indicator parameters?
I guessed that, but I can't find them, the stop loss parameters