Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 588
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
I am closing 4 positions at once, how can I count them as one in a row in the loss-counting function?
They may close, because of slippage, not at the same price and the time may be different
Trial:
If the broker allows counter closing, we should open a counter order with a volume equal to the volume of cumulatively closed orders to fix the closing price. Then the closing price is fixed and you can leisurely execute 4 trades to close the opposite orders.
Can you tell me how to determine how the margin is calculated?
Some brokers charge margin on each position. And some brokers, only on the difference in volumes on buy and sell. (I.e. if the account is full lock, then the margin is zero)
How do I determine the method of margin calculation programmatically?
Hello. I am looking for a fractal above the MA.
Looking for a fractal above the MA, I memorize a bar, then I look for a fractal from this bar and if it is less than the first one I find, then true
Constantly false in the comments
Hello. I am looking for a fractal above the MA.
Looking for a fractal above the MA, I memorize a bar, then I look for a fractal from this bar and if it is lower than the first one I find, then true
Constantly false in the comments
The problem is in this line
If a fractal is found and it is above the MA, we should interrupt the cycle instead of continuing it. After the first fractal is found there will be another one and a third one and so on to ...
The problem is in this line
If a fractal is found and it is above the MA, we should interrupt the cycle instead of continuing it. After the first fractal is found there will be another one and a third one and so on to ...
Thank you. Replaced by break;Now it is always true. but the conditionif(fr2<fr1) is not met.
So we have to add this condition before displaying the function's result. What is so hard about it?
So you have to add this condition before the function outputs the result. What's so hard about it?
Shouldn't the function return false if the condition is not met?
Shouldn't the function return false if the condition is not met?
Check that iFractals returns zero or an empty value.
Check that iFractals returns zero or an empty value.
There is an empty value in the data window. Replacedif(f!=0) with if(f!=EMPTY_VALUE), the result is unchanged.
1. I said check, not replace. iFractals returns 0 if there is no fractal. I don't use it regularly and naturally I don't clog up the undried remnants of memory with such trivia.
2. The function, though terribly written, still works fine.
3. The last value is displayed in Comment. Replace it with
And see how many times it prints