Forex
Google
New signals service!

Go Back   Forex Trading > Metatrader Training > Metatrader 4 mql 4 - Development course > Questions


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-12-2006, 07:39 PM
Aaragorn's Avatar
Senior Member
 
Join Date: Jun 2006
Location: USA
Posts: 801
Aaragorn is on a distinguished road
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)
PHP Code:
 Parameters:
symbol   -   Symbol for trading
cmd   -   Operation typeIt 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 textLast part of the comment may be changed by server
magic   -   Order magic numberMay 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

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 Code:
 Parameters:
symbol   -   Symbol for trading
cmd   -   Operation typeIt 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 textLast part of the comment may be changed by server
magic   -   Order magic numberMay 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() ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-12-2006, 10:19 PM
Senior Member
 
Join Date: Feb 2006
Posts: 525
Michel is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-13-2006, 11:51 PM
Aaragorn's Avatar
Senior Member
 
Join Date: Jun 2006
Location: USA
Posts: 801
Aaragorn is on a distinguished road
Quote:
Originally Posted by 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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-14-2006, 07:32 AM
Senior Member
 
Join Date: Feb 2006
Posts: 525
Michel is on a distinguished road
Quote:
Originally Posted by Aaragorn
It has meaning for me, that's my question..Could this be changed?
If you ask Slawa, he will say "No"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-14-2006, 07:53 AM
Member
 
Join Date: Mar 2006
Posts: 49
pipeline is on a distinguished road
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.





Quote:
Originally Posted by 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 07-17-2006, 06:16 PM
Aaragorn's Avatar
Senior Member
 
Join Date: Jun 2006
Location: USA
Posts: 801
Aaragorn is on a distinguished road
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)

Last edited by Aaragorn; 07-17-2006 at 06:24 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 07-17-2006, 10:31 PM
Senior Member
 
Join Date: Jun 2006
Posts: 313
EACAN is on a distinguished road
Quote:
Originally Posted by 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameters of this indicator? SloForeX Indicators - Metatrader 4 1 11-16-2006 06:20 PM
How change parameters in EA ? Jovager Expert Advisors - Metatrader 4 2 10-29-2006 02:30 AM
Have parameters need a MT4 programmer trevtrade Suggestions for Trading Systems 4 03-08-2006 02:10 PM


All times are GMT. The time now is 03:08 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.