Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1610
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
Can you tell me how to shorten the construction?
The point is to cut off pairs that already have a symbol in them
I have a position on USDCHF
===
There is a position on EURGBP, the signal came from AUDUSD - how can we detect that there is no position on AUD or USD ?
Valery's thinking is correct. But I do not understand why we should identify the currency we are looking for in the order currencies at each iteration of the cycle? And it seems easier to me to take the margin currency and profit currency instead of looking in the line. Look at the currency specification... I would do this
StringFind
I think there should be 2 lines, searching both 0 and 3 positions. To cut off a random match in the middle.
SZ
Dumb, there are 4 conditions.
Not equal A B and not equal C D
condition A==C or A==D or B==C or B==D
I don't think anyone could write it)))
Dumb at the second attempt. Apparently the time has come in the evening.
Can you tell me how to shorten the construction?
The point is to cut off pairs that already have a symbol in them
I have a position on USDCHF
===
There is a position on EURGBP, the signal came from AUDUSD - how to detect that there is no position on AUD or USD ?
I would collect all open order currencies in an array and go through the array upon receiving the signal.
Valeri has the right direction of thought. But I don't understand why we need to define the currency we are looking for in the order currencies at each iteration of the cycle? And I think it's easier to take the margin currency and profit currency instead of looking in the line. Look at the specification for currencies ... I would do so
I will check it tomorrow.
I would collect all open order currencies in an array and look through the array upon getting a signal.
The idea is the same, but you also need an array
you can also set a magic 1 = AUD, 2 = EUR.... for each currency and compare magics,
about the arrays, imho, it is rational, now 3 currency pairs 4 conditions, tomorrow 33 currency pairs 34 conditions?
I'll check it tomorrow.
The point is the same, but you also need an array
I didn't check everything before writing, but I didn't find any matches...
The meaning is the same, but you also need an array
Well, the point is quick - took the currency code, made a search using a ready-made array, which is updated when a trade is opened.
Help with the code. I need the pending order to move with opening of a new bar on the trend line.
I.e. it would be a permanent crossing of the order and the line.
We should know the crossing point of the trend line and time in order to make it shift. How to calculate it?
I.e. it would be a permanent crossing of the order and the line.
We should know the crossing point of the trend line and time in order to make it shift. how to calculate it?
Question about static variable var of X::doJob() method. There's a class U which creates an object of type X, does some work and then destroys it. And this happens periodically. Question: when is the var variable deleted?