
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, all.
Question on the function
I have a multi-currency counterpart. The pairs are set in external parameters. With its own magician (for each pair).
Among the entry conditions for each instrument there is this:OR (for the second pair)
What happened is that I charged both symbols yesterday - EURUSD, and this morning I found that only one trade opened, although there seemed to be signals in both cases.
And then it occurred to me. That the function
First it checks if there is an open position for a symbol. And then everything else.In other words, if I have an open position with the EA for the instrument EIRUSD, the second position will not open even with another magician according to a different algorithm.
Please, tell me if it is true or not?
Or am I wrong in my reasoning? Or the function evaluates all criteria oneby one ...
I often use this function, it returns everything according to the input parameters. The items that the function goes through are sorted sequentially according to the parameters. See for yourself.
So it means that my EA will not be able to open a second EURUSD position, even with another magician, as long as the first position is open ?
Apparently so. Because even in the tester it doesn't seem to see any overlapping positions.
//--------------------------------------------------------
So, it means that my EA will not be able to open the second EURUSD position even if it has another magician, while the first position is open?
Exactly the opposite :)) It means that the function counts your symbols and magic numbers separately. That is, if there is an open position on EURUSD with Magic_1, then NumberOfPositions("EURUSD", -1, Magic_2)==0; unless there is another position on EURUSD with Magic_2.
In general, the function counts open positions according to (sy && op && mn), i.e. positions will be counted exactly with these parameters. If there is no match of at least one parameter, the order will not be taken into account by this function, and it will not be displayed.
Print the function values in Comment and you will be able to see in real time the number of orders and whether the function is working correctly. Most likely the reason for the algorithm malfunctioning is in the EA code.
Adding a binding to the symbol in the function call does not help. Why does it count the profit for each position separately (picture above)?
Nah, I'd rather offer you my drawing...
...and a script...
Nah, I'd rather offer you my drawing...
...and a script...
I've realised I'm a fool... You can't get udders by adding beef and milk.
Angela, the compiler didn't expect to find my function definition in this very place. This means that somewhere above the code you have something missing. It may be a semicolon or a closing curly brace. Anyway, check the code carefully.
I figured it out, I just inserted your function inside int start(), when I put it outside int start(), everything compiled. The problem is different, in the indicator in visualisation mode in the tester this function doesn't get data from the EA to the indicator.
Lucky$ & KimIV
http://www.kimiv.ru
Hello Igor!
I use your Expert Advisor, it is very good, I have tried to attach indicator to it through iCustom yesterday but iCustom did not see it. I wonder what build-in functions like iHigh, iLow see it without any problem, but it refuses to place pending orders via indicator.
I put it like this for iHigh and iLow of the day bar. This function works as expected, places pending orders, but does not want to place pending orders with indicator(((.... i would like to show the code fragment on how to place pending orders by the indicator in this EA? The indicator may be anything but a call to iCustom function .
If you have some time, thank you.