Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

 
 
Thread Tools
 
Old 07-12-2006, 08: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 07-12-2006, 11:19 PM
Senior Member
 
Join Date: Feb 2006
Posts: 587
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 07-14-2006, 12:51 AM
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 07-14-2006, 08:32 AM
Senior Member
 
Join Date: Feb 2006
Posts: 587
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 07-14-2006, 08: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 07-17-2006, 07: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 07:24 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 
Old 07-17-2006, 11: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
 

Bookmarks
Thread Tools

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 07:20 PM
How change parameters in EA ? Jovager Expert Advisors - Metatrader 4 2 10-29-2006 03:30 AM
Have parameters need a MT4 programmer trevtrade Suggestions for Trading Systems 4 03-08-2006 03: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.