Forex
Google

Go Back   Forex Trading > Discussion Areas > Setup Questions
Forex Forum Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


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 10-30-2006, 06:16 PM
Diam0nd's Avatar
Diam0nd Diam0nd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 235
Diam0nd is on a distinguished road
Question 'extern double Lots' question

To start off, I am a beginner MQL programmer. Now, here goes a beginner question.

I have a variable defined in my EA:
Code:
extern double Lots = 0.1;
However, when the EA trades, it uses 1.0 lots, even though the 0.1 is set under variable above. Could anyone please be so kind to explain me how do I make sure that EA uses the lot size I set in the variable? Is there any special code I need to add to my expert?



Thanks in advance,
Diam0nd.
__________________
- MetaTrader v4.00 Build 216 (16 Apr 2008)
- MetaTrader MultiTerminal v4.00 Build 213 (20 Mar 2008)
- Always use the latest (^ABOVE^) MetaQuotes products, saves a lot of nerves. What's new.
"METAQUOTES FOR LIFE!"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-30-2006, 07:25 PM
raff1410's Avatar
raff1410 raff1410 is offline
Senior Member
 
Join Date: May 2006
Location: 24°10' E 54°24' N
Posts: 201
raff1410 is on a distinguished road
Try to find and modify all "OrderSend" functions in EA... Add "Lots" variable...

OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);

Quote:
Originally Posted by Diam0nd
To start off, I am a beginner MQL programmer. Now, here goes a beginner question.

I have a variable defined in my EA:
Code:
extern double Lots = 0.1;
However, when the EA trades, it uses 1.0 lots, even though the 0.1 is set under variable above. Could anyone please be so kind to explain me how do I make sure that EA uses the lot size I set in the variable? Is there any special code I need to add to my expert?



Thanks in advance,
Diam0nd.
__________________
http://www.gummy-stuff.org/raff-regression.htm

http://www.try-your-luck.com/

Lost in action ;-)... just_raff1410[at]yahoo.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-02-2006, 11:30 AM
Diam0nd's Avatar
Diam0nd Diam0nd is offline
Senior Member
 
Join Date: Oct 2006
Posts: 235
Diam0nd is on a distinguished road
Smile

Quote:
Originally Posted by raff1410
Try to find and modify all "OrderSend" functions in EA... Add "Lots" variable...

OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-25*Point,Ask+25*Point,"My order #2",16384,0,Green);
Superb! Thanks so much for the info
__________________
- MetaTrader v4.00 Build 216 (16 Apr 2008)
- MetaTrader MultiTerminal v4.00 Build 213 (20 Mar 2008)
- Always use the latest (^ABOVE^) MetaQuotes products, saves a lot of nerves. What's new.
"METAQUOTES FOR LIFE!"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I check for a double top or double bottom iscuba11 Metatrader 4 4 04-25-2008 08:19 AM
double exponencial greenmouse General Discussion 8 06-13-2007 10:51 PM
Lots of $$ and lots of potential... dukeofdents Suggestions for Trading Systems 5 04-08-2007 02:19 AM
can i extern a selectable variable? winnysunny General Discussion 1 04-19-2006 01:49 AM
Double CCI crossover Thruline Indicators - Metatrader 4 1 12-14-2005 08:22 AM


All times are GMT. The time now is 10:59 AM.