How many parameters can the OrderSend allow?

 

int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)

Parameters:

symbol - Symbol for trading.

cmd - Operation type. It can be any of the Trade operation enumeration.

volume - Number of lots.

price - Preferred price of the trade.

slippage - Maximum price slippage for buy or sell orders.

stoploss - Stop loss level.

takeprofit - Take profit level.

comment - Order comment text. Last part of the comment may be changed by server.

magic - Order magic number. May be used as user defined identifier.

expiration - Order expiration time (for pending orders only).

arrow_color - Color of the opening arrow on the chart. If parameter is missing or has CLR_NONE value opening arrow is not drawn on the chart.

[/PHP]

is there any reason I can't make it this...could it be made possible to do this?

int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE, double custom)

[PHP] Parameters:

symbol - Symbol for trading.

cmd - Operation type. It can be any of the Trade operation enumeration.

volume - Number of lots.

price - Preferred price of the trade.

slippage - Maximum price slippage for buy or sell orders.

stoploss - Stop loss level.

takeprofit - Take profit level.

comment - Order comment text. Last part of the comment may be changed by server.

magic - Order magic number. May be used as user defined identifier.

expiration - Order expiration time (for pending orders only).

arrow_color - Color of the opening arrow on the chart. If parameter is missing or has CLR_NONE value opening arrow is not drawn on the chart.

custom - used for custom order identification and special programming function control.

Could I then call that parameter with OrderCustom() ?

and modifiy with adding the same parameter to the

OrderModify() ?

 

No, you cannot.

Every function has a specific number of parametres wich has no meaning to be changed.

If you call a function with a number of params different from what the function assumes to receive, you get only this error at compil time: Invalid parameters count in function call.

 
Michel:
No, you cannot.

Every function has a specific number of parametres wich has no meaning to be changed.

If you call a function with a number of params different from what the function assumes to receive, you get only this error at compil time: Invalid parameters count in function call.

It has meaning for me, that's my question..Could this be changed?

 
Aaragorn:
It has meaning for me, that's my question..Could this be changed?

If you ask Slawa, he will say "No"

 

Michel probably meant "which is not meant to be changed".

This is true of built-in functions (such as OrderSend()) as well as of custom functions.

If you define:

My_function(string name, int age)

{

Print("Hello. My name is ",name,", I am ",age," years old. How interesting.");

}

and you make the function call My_function("Jesus", 2000, Jerusalem), it will not work.

Same thing with OrderModify or any other function.

Of course you can modify custom functions. But you can't modify built-in functions.

Michel:
No, you cannot.

Every function has a specific number of parametres wich has no meaning to be changed.

If you call a function with a number of params different from what the function assumes to receive, you get only this error at compil time: Invalid parameters count in function call.
 

so I'm not stuck with the built in functions I can make a custom function that does everything the built in one does + one more parameter? That should be easy enough.

Initial order with...

int OrderSend1( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE, bool control=False)

when function executes...

bool OrderModify1( int ticket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE, bool control=True)

 
Aaragorn:
so I'm not stuck with the built in functions I can make a custom function that does everything the built in one does + one more parameter? That should be easy enough.

Initial order with...

int OrderSend1( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE, bool control=False)

when function executes...

bool OrderModify1( int ticket, double price, double stoploss, double takeprofit, datetime expiration, color arrow_color=CLR_NONE, bool control=True)

Aaragorn it's like this .. For MT4 to recognize a command and initiate something it needs to understand the command send to it if you do create above function as ORDERSEND1(..... with your own parameters ) it will work for you but MT4 will not understand it and it will not open any order for you simply because there is no OrderSend() function which takes extra parameter what you can do is like

create a function as

say---

void ControlOrders( bool control )

{

// Here you can check your control variable if every thing is right then

normal OrderSend() function.

}

maybe this is what you are looking for

regards

EACAN.

Reason: