Forex



Go Back   Forex Trading > Discussion Areas > Metatrader 4
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

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 09-04-2006, 06: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 09-04-2006, 08:34 AM
Administrator
 
Join Date: Sep 2005
Posts: 20,082
Blog Entries: 243
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, 77 views)
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!
Reply With Quote
  #3 (permalink)  
Old 09-04-2006, 09:11 AM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 723
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 09-04-2006, 09:25 AM
Administrator
 
Join Date: Sep 2005
Posts: 20,082
Blog Entries: 243
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 09-04-2006, 05: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 09-04-2006, 08: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 09-04-2006, 08:22 PM
Kalenzo's Avatar
Senior Member
 
Join Date: Dec 2005
Location: Bydgoszcz - Poland
Posts: 723
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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 09-05-2006, 03: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!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Lots of $$ and lots of potential... dukeofdents Suggestions for Trading Systems 5 04-08-2007 03:19 AM
Change Lots hellkas Questions 5 10-08-2006 07:11 PM
How i calculate lots? DooMGuarD Questions 4 05-29-2006 10: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:55 PM.



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