Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 529
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
Like this?
I would cycle like this:
I'm used to postdecrement/postincrement - it makes sense to me, unlike prefix increment/decrement, since (from the help) prefix increment (++i) and decrement (--k) are applied to a variable just before using that variable in an expression.
Your comparison, on the other hand, is not correct at all:
Here you are normalizing a Boolean value - the result of comparison of two values - the value of the Ask-OrderStopLoss() expression is compared to the value of the Trailing*Point expression and then you normalize the result of this comparison.
The comparison result can only be false (0) or true (not zero). So it is this zero or nonzero that you will normalize.
That's how you should do the comparison:
I have a function with two objects:
One of the classes has a structure with more than 4000 fields (mostly enums).
What to do with this error?
Here the size of local variables is too large (more than 512kb) at compile time.
What to look for and what to do? The function has a string array CArrayString, I suspect the error may be related to it.
I fill it using Add() method, then do Clear() and Shutdown() again. And then I fill it again with new data using Add() method. In this case, will the array be filled again from null element?
How do I know, in history, the longest sequence of consecutive, multi-directional candles?
For example: the first one is bearish, the second one is bullish, the third one is bearish and so on. I suppose we need a loop and a variable to record the number of such candles, but I do not know what the loop should be and how, by what condition, to exit it.
How do I know, in history, the longest sequence of consecutive, multi-directional candles?
For example: the first one is bearish, the second one is bullish, the third one is bearish and so on. I suppose we need a loop and a variable for recording the number of such candles, but I don't know what the loop should be and how to exit it, by what condition.
I don't know what kind of loop should be used to exit it.
CopyRates and loop over an array of MqlRates structures.
Thanks, a loop on an array, how? and when to exit from it?
Thank you, the array loop, how? and when to exit it?
How do I know, in history, the longest sequence of consecutive, multi-directional candles?
For example: the first one is bearish, the second one is bullish, the third one is bearish and so on. I suppose we need a loop and a variable for recording the number of such candlesticks, but I do not know what the loop should be and how, by what condition, to exit it.
I do not know what kind of cycle it should be but I do not know what condition to exit it from.
then come out as soon as the sequence is broken.
How do I record this sequence in the first place?
And count from where the maximum consistency, from when forex was created?
It would be great) But the broker's history is limited, search through all available. or for the past year i.e. since 15. 04. 17
How, in general, is this sequence to be written down?
How to write it, Alexey answered. It would be great if he could write the code as he sees it, if he has time and wish).
I see the implementation through a flag, but it seems wrong to me, that I don't even want to start trying.
PS. By the way, is it an indicator, or an EA?