Download MetaTrader 5

Find the missed parameters in these codes

To add comments, please log in or register
Mahmood
75
Mahmood  
When I compail these code i get error missed parameters 

OrderSend (pair,action,volume(),MarketInfo(pair,MODE_ASK),3,stopLose1,takeProfit1,,,0,Green);

OrderModify(OrderToModify(),,stopLose1,takeProfit1,0,Green);

For both i recive this error:  ',' - syntax error, parameter missed

But for this one:
OrderClose(OrderToModify(),OrdersLots(),MarketInfo(pair,MODE_ASK),3,);

I recive error:  ')'- syntax error, parameter missed 

What and where do i missed parameters? 
All Variables are initialized before for example, pair contains string "eurusd", action contains string "OP_BUY", OrderToModify() is a function which returns a ticket
variable action contains a string value, is that my Problem? 
Mahmood
75
Mahmood  
Mahmood000:
When I compail these code i get error missed parameters 

OrderSend (pair,action,volume(),MarketInfo(pair,MODE_ASK),3,stopLose1,takeProfit1,,,0,Green);

OrderModify(OrderToModify(),,stopLose1,takeProfit1,0,Green);

For both i recive this error:  ',' - syntax error, parameter missed

But for this one:
OrderClose(OrderToModify(),OrdersLots(),MarketInfo(pair,MODE_ASK),3,);

I recive error:  ')'- syntax error, parameter missed 

What and where do i missed parameters? 
All Variables are initialized before for example, pair contains string "eurusd", action contains string "OP_BUY", OrderToModify() is a function which returns a ticket
variable action contains a string value, is that my Problem? 

Help
honest_knave
Moderator
2318
honest_knave  

Probably best to wait more than 25 minutes for a reply before bumping your topic ;-)

You need to put values in between your commas:

OrderSend (pair,action,volume(),MarketInfo(pair,MODE_ASK),3,stopLose1,takeProfit1,,,0,Green);
OrderModify(OrderToModify(),,stopLose1,takeProfit1,0,Green);
OrderClose(OrderToModify(),OrdersLots(),MarketInfo(pair,MODE_ASK),3,);
Mahmood
75
Mahmood  
honest_knave:

Probably best to wait more than 25 minutes for a reply before bumping your topic ;-)

You need to put values in between your commas:


Ok don't get mad on me Im new here and don't know your rules
All resolved but the parameter i missed in OrderModify line is an open price which I dont want to modify it,  should I put 0 there?
Thank you 
Carl Schreiber
7365
Carl Schreiber  
Mahmood000:

Ok don't get mad on me Im new here and don't know your rules
All resolved but the parameter i missed in OrderModify line is an open price which I dont want to modify it,  should I put 0 there?
Thank you 

Sir I would like to remind you respectfully that with the mql editor connected you can find the MQL4 reference where you can find the answers of 99% of your questions.

And if you are not sure whether this or that works just create a little script and check it out yourself - you can run it in the debugger - a very helpful tool!!

 This way is a lot faster than posting here and waiting for someone willing to answer. Many people don't like to spend their time on such too simple things - one feels a bit stupid.

WHRoeder writes once and a while learn to code let me add: learn to read before that.

To add comments, please log in or register