Need help - page 2

 
Sergey Korsunov #:

didn't help ((

Your main mistake: you were opening orders at the Ask price, which was taken from the instrument on whose chart the EA is installed. You should use MarketInfo()
 
a007 #:

Try this - Shorter and more precise

everything worked, just super, from the heart!
but unfortunately there is still one unresolved issue
in my version there should be several parameters

string name[10]={"AUDJPY","C....

with possibility of specifying a value in "Entry Parameters",
i.e. open 6 orders from a certain defined list,
Example of list:
1. "AUDCHF, EURAUD, NZDJPY, EURCHF, EURJPY, CADJPY"
2
. "GBPCHF, GBPAUD, AUDJPY, GBPUSD, GBPJPY, CHFJPY"
3. "......, ......, ..."
4. "......, ......, ..."
etc
help?

 
zvezdocheet #:
Your main mistake: You have opened orders at the Ask price, which was taken from the symbol on whose chart the EA is placed. You have to use MarketInfo()

Thanks for the answer, but unfortunately I'm not fluent in the language (
i.e. should I put MarketInfo() instead of Ask ?
if not, can you show me how it should look like in my code?

 
Sergey Korsunov #:

Thanks for the answer, but unfortunately I'm not good at the language (
i.e. should I put MarketInfo() instead of Ask ?
if not, can you show me how it should look like in my code?

See in my program how it is done in the longest line

 
Sergey Korsunov #:

everything worked, just super, from the heart!
but unfortunately there is still one unresolved point
in my version there should be several parameters

with possibility of specifying a value in "Input parameters",
i.e. open 6 orders from a certain defined list,
Example of list:
1. "AUDCHF, EURAUD, NZDJPY, EURCHF, EURJPY, CADJPY"
2
. "GBPCHF, GBPAUD, AUDJPY, GBPUSD, GBPJPY, CHFJPY"
3. "......, ......, ..."
4. "......, ......, ..."
etc.
help?

And if you put the list of instruments in a text file and fill in an array of names from this file in the OnInit() function when you run the Expert Advisor?

 
a007 #:

See in my programme how this is done in the longest line

ok

 
a007 #:

And if the list of tools is placed in a text file and when you run the EA in the OnInit() function fill the array of names from this file?

Ok
only the list will consist of 70 lines of 6 vp
and one more thing, if it's not difficult, please make sure that in the "Input parameters" you can choose to open only buy or sell.

 
Sergey Korsunov #:

ok
only the list will consist of 70 lines of 6 vp
and one more thing, if it is not difficult, please make it possible to choose in the "Input parameters" to open only buy or sell.

like this

enum torg
{
   buy,  // Покупка
   sell  // Продажа
};
extern torg xxx;

.............
.............

if(xxx==buy)  OrderSend(name[k],OP_BUY,...
         else OrderSend(name[k],OP_SELL,...
 
a007 #:

like this

I don't quite understand what goes where, or rather I see some things that I understand, but I don't know where to put it in the code (
 
Sergey Korsunov #:
I don't quite understand what's where, or rather I see some things I understand, but I don't understand where to put it in the code (

What's above the dots is at the very top. Paste it and see what happens

And when you see how great it is, paste the bottom part instead of OrderSend(...)

Reason: