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

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 12-23-2005, 10:21 AM
Senior Member
 
Join Date: Oct 2005
Location: Porto/Portugal
Posts: 333
hellkas is on a distinguished road
Change Lots

Hi all...

What I've to do to change lots?

PHP Code:
int LotCalc(double Risk)
  {
   
int vLots=0;
   if (
UsePct >&& Risk>0vLots=MathFloor(AccountBalance()*(UsePct/100)/((Risk/MarketInfo (Symbol(), MODE_POINT))*10));
   if (
UsePct >&& Risk==0)  vLots MathFloor(AccountBalance()*(UsePct/100)/1000);
   if (
vLots>MaxLotsvLots=MaxLots;
   if (
vLots<1vLots=1;
   return(
vLots);

I already changed for 0.1 but the EA dont trade..
But if I change for 2 lots it trade normally..

Any help I appreciate..

Tks
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 12-27-2005, 04:14 PM
Senior Member
 
Join Date: Dec 2005
Posts: 142
trevman is on a distinguished road
that looks overly complicated, heres what i use

Code:
   double lots = NormalizeDouble(AccountFreeMargin()/(500/0.1),1);
this uses 0.1 lot for every 500 in your account, adjust them as you see fit. hope this helps.
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 12-30-2005, 11:09 AM
Senior Member
 
Join Date: Oct 2005
Location: Porto/Portugal
Posts: 333
hellkas is on a distinguished road
Quote:
Originally Posted by trevman
that looks overly complicated, heres what i use

Code:
   double lots = NormalizeDouble(AccountFreeMargin()/(500/0.1),1);
this uses 0.1 lot for every 500 in your account, adjust them as you see fit. hope this helps.

hi trevman...

Thanks for your help but dont result..

Do you've other way? Anyone?
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 12-30-2005, 12:15 PM
Member
 
Join Date: Dec 2005
Posts: 32
zuhainis is on a distinguished road
I think your problem is here:

if (vLots<1) vLots=1;
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 12-30-2005, 07:01 PM
Senior Member
 
Join Date: Oct 2005
Location: Porto/Portugal
Posts: 333
hellkas is on a distinguished road
Quote:
Originally Posted by zuhainis
I think your problem is here:

if (vLots<1) vLots=1;
hi zuhainis...
Thanks for your reply

I already changed
PHP Code:
if (vLots<1vLots=1
to
PHP Code:
if (vLots<0.1vLots=0.1
but dont trade
error message: EURUSD,H1: invalid lots number for OrderSend function

What i've to do now?
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 10-08-2006, 07:11 PM
Junior Member
 
Join Date: Jul 2006
Location: North Carolina, US
Posts: 7
ScottB is on a distinguished road
Change lots

My guess is that you are returning an int instead of a double (the lots parameter is a double). Anything less than 1.0 will be truncated and end up as zero (trust me, I have done it and looked for hours until I found the problem).

I hope this helps, good luck.
Scott
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
Increase or Decrease lots nomz Questions 1 06-09-2006 12:07 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 01:58 PM.



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