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

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
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.
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.
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);
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?
Thank you very much.
Why is (int) put in front of the expression?
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.
Good day! Can you tell me how to express a candle as a percentage, if I am illiterate?