Advice on not using the MetaTrader 4 Strategy Tester - page 3

 
I think he knows a lot more about programming than I do (at the moment I only know MQL-IV very well, I don't need the rest). I feel that he is trying to beat the market head-on with strict and accurate algorithms, and if that doesn't happen - the tester or the broker is to blame. Tester - because written EA that shows profit on history on one model does not show exactly the same on another one (type of modeling, time frame, etc.). Broker - if there are no errors in the code, but it is impossible to repeat the exact behaviour of the Expert Advisor in real life.
Only his hesitations are incomprehensible - now he denies in principle the possibility of earning on forex using the MTS, then begins to sell his adviser, then offers to rent a server or an adviser. In general, as far as I understand it, he needs an outrage. Even the names of his topics are in advertising style.
Programmer, no longer writing MTS, EAs for MetaTrader4, Omega, MetaStock
 
Rosh:
I think he knows a lot more about programming than I do (at the moment I only know MQL-IV very well, I don't need the rest). I feel that he is trying to beat the market head-on with strict and accurate algorithms, and if that doesn't happen - the tester or the broker is to blame. Tester - because written EA that shows profit on history on one model does not show exactly the same on another one (type of modeling, time frame, etc.). Broker - if there are no errors in the code, but it is impossible to repeat the exact behaviour of the Expert Advisor in real life.
Only his hesitations are incomprehensible - now he denies in principle the possibility of earning on forex using the MTS, then he starts selling his EA, or offers to rent a server or an EA. In general, as far as I understand it, he needs an outrage. Even the names of his topics he uses in advertising style.
Programmer, no longer writing MTS, EAs for MetaTrader4, Omega, MetaStock

It seems that he has not even completed the first round of "learning" yet. After the third, in a couple of years, he will have a more real understanding. Everyone goes through the phase of burrowing into the raw quote stream, trying to find the "depth and truth" of the market in it. Although the depth of the market is at least exactly in the opposite direction.
 
<It looks like he hasn't even completed the first round of "learning" yet. After the third, in a couple of years, he will have a more realistic understanding. Everyone goes through the phase of burrowing into the raw quotation stream, trying to find the "depth and truth" of the market in it. Although the depth of the market is at least exactly in the opposite direction. >

Michael Psyll. On the energy and action of demons.

Ars longa, vis longitur est.
 
Renat писал (а):
rebus wrote (a):
There are some unpleasant misunderstandings. My program is not ticking, it's quite crude. It seems like it should not react to small things. But when explicit conditions are not met, I don't get it. In addition, very often there is an opening outside the bar. This is nonsense to me because I thought all ticks should be accounted for in the bar. But no. I.e. let's try to find the reason.
Please publish the full code and screenshots of charts with openings outside the bar. Very interesting to see.

You already have the code. But does the execution of stop-losses depend on Expert Advisor codes? Or maybe I still don't know something?

Example 1:



Explanation: High bar 1.2073

Example 2:



Explanation: High bar 1.1892

I cannot give examples of openings outside the bars because I check this situation programmatically. As for the closures, I am not sure yet. There are not many of them, but they do occur. They are within 2-3 points above or below a bar. I cannot understand the reason. Maybe you may be able to explain me something?

This is what concerns the tester. I have my own problems with demo in real time. I will prepare and send you examples.
 
>It's still unclear about the closures. There are not many such closes, but they are there. Within 2-3 pips above or below the ?>bar. I do not understand the reason. Maybe you will be able to explain me something?

The Sell position is closed at Ask price. The terminal shows Bid prices. Hence your 2-3 pips spread.
 
Example from recent live demo positions.



Explanation: High bar 1.2761. SL 1.2764 triggered on the demo, but on the tester during the subsequent run there was no position closing in this place! It closed substantially lower (the place can be seen on the edge of the chart in the lower left corner - where the upper limit of the channel turned up).

It turns out that there was a price of 1.2764 in the real price flow, but it was not present in the simulation. And of course it was not shown in the bar. To be more exact, it naturally did not show up for testing, but why was it not shown on the real chart as well? The chart is real. Not from the tester.
 
solandr писал (а):
>It's still unclear about the closures. There are not many such closes, but they are there. Within 2-3 pips above or below the ?>bar. I do not understand the reason. Maybe you will be able to explain me something?

The Sell position is closed at Ask price. The terminal shows Bid prices. Hence your 2-3 pips spread.
It means that High bar = max Bid, Low bar = min Ask. Right? I've never thought about it, because I didn't think about it that much.
But it doesn't always add up. Look at my last example.
 
> I.e. High bar = max Bid, Low bar = min Ask. Right? I've never really thought about it, >because I don't need to.
>But it does not always add up. Look at my last example.

You just do not understand the concept of Ask and Bid prices!
In the price stream quoted by the terminal, there are always 2 prices Bid and Ask. Usually the difference between them is mentioned in the broker's terms of trade on a normal market. For example, the broker says about 2 or 3 pips of the difference (spread) between these prices. On a fast market this difference can easily reach 7 pips on EURUSD.

Sell orders can always be opened only at the Bid price and Buy orders at the Ask price. The Ask price is higher than the Bid price.
Thus, the broker allows you to open at the price of one type and close at the price of another type in order to withdraw money from the client for the trade. The difference will have to be in the broker's pocket. Respectively, he will open a Sell position at the Bid price and close it at the Ask price - respectively, the difference Ask-Bid goes to his pocket (formally, it is deducted from your possible profit). For Buy, it is vice versa. He opens a BUY at the Ask price, and closes it at the Bid price. Accordingly, Ask-Bid will again go into his pocket.

Although, I just figuratively simplified the whole difference of Ask-Bid going into his pocket in order to explain the principles of the buy-sell price formation. In fact, not all of the profit goes into his pocket. Part of it is taken by the Forex market itself, where your broker himself buys-sells your deals, but with a smaller spread, for example, with a spread of 1 point. That is, if you play with 2 point spread, and the broker with 1 point spread, then 1 point of spread in any case, formally, must settle in the pocket of the broker.

That is the explanation. Although it's written about it in many sources for beginners.
 
All bars are based on bids.
It turns out that incorrect statements are made on the basis of ignorance of the existence of the Ask price.
 
solandr писал (а):
> I.e. High bar = max Bid, Low bar = min Ask. Right? I've never really thought about it, >because I don't need to.
>But it does not always add up. Look at my last example.

You just do not understand the concept of Ask and Bid prices!
In the price stream quoted by the terminal, there are always 2 prices Bid and Ask. Usually the difference between them is specified by the broker in the terms of trade. For example, the broker says about 2 or 3 pips of the difference (spread) between these prices. On a fast market this difference can easily reach 7 pips on EURUSD.

Sell orders can always be opened only at the Bid price and Buy orders at the Ask price. The Ask price is higher than the Bid price.
Thus, the broker allows you to open at the price of one type and close at the price of another type in order to withdraw money from the client for the trade. The difference will have to be in the broker's pocket. Respectively, he will open a Sell position at the Bid price and close it at the Ask price - respectively, the difference Ask-Bid goes to his pocket (formally, it is deducted from your possible profit). For Buy, it is vice versa. He opens a BUY at the Ask price, and closes it at the Bid price. Accordingly, Ask-Bid will again go into his pocket.

Although, I just figuratively simplified the whole difference of Ask-Bid going into his pocket in order to explain the principles of the buy-sell price formation. In fact, not all of the profit goes into his pocket. Part of it is taken by the Forex market itself, where your broker himself buys-sells your deals, but with a smaller spread, for example, with a spread of 1 point. That is, if you play with 2 point spread, and the broker with 1 point spread, then 1 point of spread in any case, formally, must settle in the pocket of the broker.

That is the explanation. Although it is written approximately in many sources for beginners.
In general, the explanation is too much for a man who is interested in Forex more than 10 years by different degrees :)
I've already written that I just didn't think about the bar construction method. There was no reason to think about it. The rest, to put it mildly, is obvious.