Download MetaTrader 5

Script: OrderType as option in a pulldown menu possible?

To add comments, please log in or register
mar
1146
mar  

Hey coders,

I want to do an order script. Right now I use the numbers 0-5 in the options to determine the type of order. Is it somehow possible to use a pulldown menu in the options from that I can choose OP_BUY, OP_SELL ... ? Sometimes the numbers are confusing because I not always know in a second what for example number 3 or 4 is.

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI  
mar:

Hey coders,

I want to do an order script. Right now I use the numbers 0-5 in the options to determine the type of order. Is it somehow possible to use a pulldown menu in the options from that I can choose OP_BUY, OP_SELL ... ? Sometimes the numbers are confusing because I not always know in a second what for example number 3 or 4 is.


Use OP_BUY / OP_SELL / etc instead of numbers.
qjol
3243
qjol  
have a look on the file: #include <Controls\ComboBox.mqh>
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI  
Let's do some codings, yeahhh... ! XD
mar
1146
mar  
Wow... What the hell is ComboBox.mqh or better: how can I use this? I have never seen an mqh-File before..
qjol
3243
qjol  
mar
1146
mar  

I do :-)

Alain Verleyen
Moderator
31183
Alain Verleyen  
mar:

Hey coders,

I want to do an order script. Right now I use the numbers 0-5 in the options to determine the type of order. Is it somehow possible to use a pulldown menu in the options from that I can choose OP_BUY, OP_SELL ... ? Sometimes the numbers are confusing because I not always know in a second what for example number 3 or 4 is.

Use something like :

enum TYPE_ORDER
  {
   BUY,
   SELL,
   BUYLIMIT,
   SELLLIMIT,
   BUYSTOP,
   SELLSTOP
  };

#property show_inputs

input TYPE_ORDER operation = BUY;      // Order type
To add comments, please log in or register