Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1052

 
rapid_minus:

How smart everyone is - just scary. If you do not know how to read: I've written that the slip is ignored in the tester (which is clear), but positions are all open, as indicated. But on the demo slip does not work, and the position is opened only one, and that closes immediately. I cannot solve this problem.

Apparently this is not the first time you've been rude, that's why no one is answering. Although you have already been given an answer to your second question.

But you could only answer like this.

Rapid_minus:
It is clear that the bid has aged, but I hoped that this design would allow to open several positions on the current bar with different bid opening prices. And it works fine in the tester, but on the demo it opens one position and closes it immediately. how to avoid it is not clear.

What were you hoping for? We have offered a solution. You should read it carefully.

 
rapid_minus:
poz = OrderSend(Symbol(),OP_SELL,lot,Bid,slip,0,0,NULL,magic,Red);
Sleep(10000);
poz = OrderSend(Symbol(),OP_SELL,lot,Bid,slip,0,0,NULL,magic,Red);
We need after each Sleep(10000); RefreshRates(); Bid will be updated and gingerbread will be ours
 
AlexeyVik:

Yes, to determine the number of decimal places. This is needed to normalize lot value if lot is defined by some formula and result may have more decimal places than allowed. In some cases, you might just put a deuce, but then you might encounter an error, so it's better to define it programmatically.

There is another way of doing it. There are two ways of solving this problem. One is to convert number to string, define string length, find index of dot character and the difference between string length and index of dot character will be evaluated as fractional part of number. And on mql5 forum, you can find several variants, some thinner, some easier.

Here is one more of my variants.

This function determines the number of decimal places of absolutely any number.

The algorithm is outrageously simple - consider how many times the residue of division by 1 is greater than zero.

I have not said that my way is better. Every programmer is writing his or her own way of solving the problem.

A number of double type, even if it has no significant digits in the fractional part, looks like 2.0, which is not quite correct, and in order to get a normal integer it is converted to int type implicitly.

Thank you very much.

But why should (int) be put before the expression?

 
Igemon:

Thank you very much.

Why is (int) put in front of the expression?

Readthis, it's very useful.
 
Thank you, LRA! As always on this thread, help comes from the wrong side of the tracks. Most of the local "gurus" do not help the newcomers, but only admire themselves, although on other branches they are sometimes in simple matters themselves. That is why they are as touchy as freshmen. Thanks also to artmedia70 for the link. It made me laugh. And it's beautiful, a little face on the tabloid.
 
At the moment the indicator records the tick chart in the Offline Chart, then the opening of the chart is manual.
Can I open a chart in an Expert Advisor from the Open Offline Chart by its name? I have looked at ChartOpen() but it does not work by name.
 
Igemon:       Why is (int) put in front of the expression?
Try it with it and try it without it. An expert on the subject said: Experience = criterion of truth
 
Hi all... Can you tell me if there is a mql4 function that fulfils the following condition: if an order opens, let's say buy on the indicator signal... Then if there is a reversal signal buy is closed and sell is opened ... etc... Or advise how to register it in your Expert Advisor ... Thanks in advance
 
good afternoon! can you please advise an illiterate person how to express the candle as a percentage?
 
kocunyc89:
Good day! Can you tell me how to express a candle as a percentage, if I am illiterate?
In order to express something as a percentage, you need to know what it should be a percentage of.
Reason: