Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 471

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
Good afternoon to everyone who cares!
I'm an advanced user. But I don't write that often. That's why. I can't keep up with some innovations. And sometimes I just forget things.
Please help me with one question. I can't remember one thing.
Here's the situation. I've defined extern variables. I've defined many of them. 20 variables.They are displayed in the input menu of the program, when you attach this program to the chart.
Here's the question. I can't remember. How do I separate blocks of these variables with comments? In the input menu. For example:
This is a block on changing MA variables (comment)
Period MA
Setting method MA
Price MA
This is a block on changing MACD variables (comment)
..........................
...........................
...........................
This is a block on changing BB variables (comment)
.........................
..............................
...........................
It seems that before I entered such comments with code comment function.That is, I wrote // or /* */. But now something does not work.
Like this
Like this.
Thanks, that reminds me!!!
Try it like this:
This is to show all significant digits of the quote. If some other number of digits is needed, replace Digits() with a specific number.
Try it like this:
This is to show all significant digits of the quote. If you need any other number of digits, replace Digits() with a specific number.
Now it prints correctly 15,155, however - invalid stoploss for OrderModify function
This problem is only with Silver in OrderModify
Now outputs correctly in Print 15,155 , however - invalid stoploss for OrderModify function
This problem is only with Silver in OrderModify
There are two errors in this code:
To solve the first problem we need to get the current Stop Level:
If fStopLevel turns out to be zero and the account type is not ECN, then fStopLevel should be forced to be equal to three spreads.
Before setting stops (both Stop Loss and Take Profit) check that the new level is at or above the Stop Level from the order close price. To check the stop for a Buy order this is done as follows:
For a Sell order stop:
The solution to the second problem: Compare real values with some accuracy, as the equality of real numbers cannot be achieved always and everywhere. I have already given an example of comparison above in the code of stop level validation.
There are two errors in this code that are striking:
To solve the first problem we need to get the current Stop Level:
If fStopLevel turns out to be zero and the account type is not ECN, then fStopLevel should be forced to be equal to three spreads.
Before setting stops (both Stop Loss and Take Profit) check that the new level is at or above the Stop Level from the order close price. To check the stop for a Buy order this is done as follows:
For a Sell order stop:
The solution to the second problem: Compare real values with some accuracy, as the equality of real numbers cannot be achieved always and everywhere. I already gave an example of comparison above in the code of stop level validation.
Thank you.
However, the question is not closed. OrderModify starts to trigger immediately when an order is opened. Where is the error? (I repeat - on all(all) currencies/futures it works, on Silver it does not)
Thank you.
However, the question is not closed. OrderModify starts to trigger immediately when an order is opened. Where is the error? (I repeat - on all(all) currencies/futures it works, on Silver it does not)
1. Directive
are you using ?
2) Does this happen with Sell and Buy, or only with Sell?
3. is the Stop loss set at position opening or should the trader set it if possible?
Thank you.
However, the issue is not closed. OrderModify starts working immediately when an order is opened. Where is the error? (I repeat - it works on all(all) currencies/futures, it does not work on Silver)
Show the log snippet (if online, the Experts tab) where you can see the market order opening and modifications and indicate which TrailingStop and TrailingStep values were used.