[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

 
Zhunko:

Anyway, without RefreshRates() my EAs won't work. I make them looped. Therefore, RefreshRates() is mandatory.

What do you mean by looped? In fact, any Expert Advisor can be said to be looped, as the start has a cycle. Once per tick...

Zhunko:

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.

It seems to me that it's you trading in kitchens, that's why the holes in history are forming. I notice it happens in lame kitchens. A quality broker shouldn't have that shit.

Zhunko:

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.


Zhunko:

Sometimes only the last bar arrives.

Where does the last bar come in?

Zhunko:

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.

Hm. Well, if market data is pulled through MarketInfo(), as I understand, there should be no errors. And if it bypasses it, of course. It seems so. I haven't checked it yet, but it seems to be the same logic.
 

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.

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?

report 2


Or both of them are of no use and we need higher mathematical expectation and so on?

 
on the EUR/USD H4 currency pair "waiting for update" is lit and does not switch to other periods what should I do?
 
shurik32:
on the EUR/USD H4 currency pair is lit " waiting for update " and does not switch to other periods what to do?
Enter history F2 swap H4!
 
Vinin:

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.

hoz:
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.

1. Like this:

extern string Tool           = "";    // Имя инструмента.
extern bool   IsRefreshRates = false; // Флаг включения обновления таймсерий.
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
void start()
 {
  string sTool = Tool; // Имя инструмента.
  if (Tool == "") sTool = Symbol();
  while (!IsStopped())
   {
    if (IsRefreshRates) RefreshRates();
    Comment("MarketInfo()\n",
            TimeToStr(MarketInfo(sTool, MODE_TIME), TIME_DATE|TIME_MINUTES|TIME_SECONDS), "\n",
            DoubleToStr(MarketInfo(sTool, MODE_BID), Digits), "  ", DoubleToStr(MarketInfo(sTool, MODE_ASK), Digits),
            "\n\nПредопределенные переменные\n",
            TimeToStr(Time[0], TIME_DATE|TIME_MINUTES|TIME_SECONDS), "\n",
            DoubleToStr(Bid, Digits), "  ", DoubleToStr(Ask, Digits),
            "\n\nМассив-таймсерия \"Close[]\"\n",
            TimeToStr(Time[0], TIME_DATE|TIME_MINUTES|TIME_SECONDS), "\n",
            DoubleToStr(Close[0], Digits));
    Sleep(300);
   }
 }

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.

 
Dmido:

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?
 
Andrew245:

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?
 
pako:

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
Reason: