Forex
Google
New signals service!

Go Back   Forex Trading > Discussion Areas > Metatrader 4


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 09-04-2006, 05:43 AM
Junior Member
 
Join Date: Sep 2006
Posts: 5
forexfordinner is on a distinguished road
Automated increasing of lots in EA

Hello,

I am trying that my EA would calculate automatically the proper lots based on available margin.

ContractSize=NormalizeDouble((((AccountFreeMargin( )*AccountLeverage())/Ask)/10000),1);

I've placed this line after the start() and before the ordersend. Of course the ordersend takes the lot size from here.

This is supposed to do it, but it doesn't works. Can anyone tell me WHY???
Txs
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-04-2006, 07:34 AM
Administrator
 
Join Date: Sep 2005
Posts: 15,947
Blog Entries: 64
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
I don't know about your particular question but i found library file inside my computer (attached). Unzip it and place to /include folder. Don't compile.
And in your EA do the following:

- place
Code:
#include <b-Lots.mqh>
after the settings of EA but before deinit(), init() and start()

- place
Code:
Lots=GetSizeLot();
before OrderSend(Symbol(), ...

- delete this line in your EA:
Code:
extern double Lots=1;
And you will have several kinds of Money management:
LotsWayChoice = 1; // 0-fixed lot size.
// 1-% from deposit,
// 2-the other kind of MM
// 3-different kind of MM
Attached Files
File Type: zip b-Lots.zip (900 Bytes, 53 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-04-2006, 08:11 AM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 693
Kalenzo is on a distinguished road
Quote:
Originally Posted by newdigital
I don't know about your particular question but i found library file inside my computer (attached). Unzip it and place to /include folder. Don't compile.
And in your EA do the following:

- place
Code:
#include <b-Lots.mqh>
after the settings of EA but before deinit(), init() and start()

- place
Code:
Lots=GetSizeLot();
before OrderSend(Symbol(), ...

- delete this line in your EA:
Code:
extern double Lots=1;
And you will have several kinds of Money management:
LotsWayChoice = 1; // 0-fixed lot size.
// 1-% from deposit,
// 2-the other kind of MM
// 3-different kind of MM
This library includes just one function so u can just copy/paste it to your ea and it will work in the same way as it it work with external file.
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-04-2006, 08:25 AM
Administrator
 
Join Date: Sep 2005
Posts: 15,947
Blog Entries: 64
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by Kalenzo
This library includes just one function so u can just copy/paste it to your ea and it will work in the same way as it it work with external file.
Yes forexfordinner can do it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-04-2006, 04:36 PM
Junior Member
 
Join Date: Sep 2006
Posts: 5
forexfordinner is on a distinguished road
Thanks a lot guys, I went to bed yesterday at 3 in the morning trying to figure this out.

Thaks again
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-04-2006, 07:15 PM
Junior Member
 
Join Date: Sep 2006
Posts: 5
forexfordinner is on a distinguished road
can´t make it work

Hí guys,

I did try to copy and paste the script in my EA...... well, I tried many ways but none seems to work. So this might sound very amateur..... could you pls indicate my where to paste it? And in the place for indicating the lots in the order send sentence, what should I write? dLot? Get...()?
Thanks in advance
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-04-2006, 07:22 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 693
Kalenzo is on a distinguished road
Quote:
Originally Posted by forexfordinner
Hí guys,

I did try to copy and paste the script in my EA...... well, I tried many ways but none seems to work. So this might sound very amateur..... could you pls indicate my where to paste it? And in the place for indicating the lots in the order send sentence, what should I write? dLot? Get...()?
Thanks in advance
First u shoud copy initial parameters (before init function) to your ea in the same place (in your ea also before init function) then just copy the GetSizeLot() after start function (this function should be added to ea after start function is closed or before start function - it is important to not to place this function inside start()) and then u can call GetSizeLot() in your ea inside the start function.
If u still have a problem with that just post your ea here I will help u to combine it.
__________________
You need proffesional mql coder? Contact me! I will help you!
........................................
http://www.fxservice.eu/
........................................
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-05-2006, 02:45 AM
Junior Member
 
Join Date: Sep 2006
Posts: 5
forexfordinner is on a distinguished road
Thanks a lot Kalenzo, it is working just great now. And you too newdigital, thanks.
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 On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lots of $$ and lots of potential... dukeofdents Suggestions for Trading Systems 5 04-08-2007 02:19 AM
Change Lots hellkas Questions 5 10-08-2006 06:11 PM
How i calculate lots? DooMGuarD Questions 4 05-29-2006 09:12 PM
Multi-Lots Eric Expert Advisors - Metatrader 4 14 03-31-2006 11:05 PM
Increasing lots with EA Willis11of12 Metatrader 4 1 03-28-2006 01:23 PM


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



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