Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 898
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
Hello! Help me do the following:
It is necessary to make a target profit for each open position in the market, but not a general one, but a separate one!
example: EURUSD opened and it has a target profit of $ 1 in its settings, and as soon as it reached it, the position closed itself, only it!
and so each currency pair should work on its own, and not according to the total profit!
I found the code for the total profit for all pairs:
help me redo it for each currency pair separately ...... Thank you in advance!
If you dig, you can find it.
doubleiOpen(
stringsymbol,// symbol
inttimeframe,// period
intshift// shift
);
if I insert the symbol name of an instrument, as it says in the manual,(not 0 and not NULL) and run it in the tester on the chart, I get the answer 0.0? At the same time 0 and NULL gives correct values. Thank you.
Hello. Can someone explain to an inexperienced person why the function
doubleiOpen(
stringsymbol,// symbol
inttimeframe,// period
intshift// shift
);
If I insert a symbolic tool name as it says in the handbook,(not 0 and not NULL) and run it in the tester on the chart, I get a 0.0 response? At the same time 0 and NULL give the correct values. Thank you.
Oops, sorry, careless: I just missed one letter in instrument name. It's OK - a linguist is a linguist.
Oops, sorry, I wasn't paying attention: I just missed one letter in the instrument name. It's OK - a linguist is a linguist.
And now I have another question: why double DJop1 = iOpen("DowJones30",PERIOD_H1,1) launched on another instrument (not DowJones30) produces correct values, while double DJbid = MarketInfo("DowJones30",MODE_BID) produces 0.0, though it works fine on DowJones30?
Thank you, it's not clear, the position is now plus, but it says 0.25.
Thank you, it's not clear, now the position is on the plus side, but it says 0.25.
That's right, do the math.
Who can help with this question https://www.mql5.com/ru/forum/160683/page897#comment_12221175?
Who can help with this question https://www.mql5.com/ru/forum/160683/page897#comment_12221175?
2019.06.27 14:20:36.265 test EURUSD,H1: MyStructDouble.val = 123.456 , MyStructDouble.ind = 123
2019.06.27 14:20:35.700 test EURUSD,H1: MyStructDouble.val = 123.456 , MyStructDouble.ind = 123
2019.06.27 14:20:35.427 test EURUSD,H1: MyStructDouble.val = 123.456 , MyStructDouble.ind = 123
2019.06.27 14:20:34.758 test EURUSD,H1: initialized
i.e. despite applying the template, you still need to assign the type
A<double> MyStructDouble;
And with classes, what would this code look like, apply a template to a class.
i.e. despite applying the template, you still need to assign the type
And with classes how would this code look like, apply a template to a class.
C++ is based on MQL, all C-like languages are strictly typed - google to help.
Exactly like my example, replace struct with class