MQL4 - automated forex trading   /  

Code Base

Code Base  Libraries  Lot_Volume To post a new code, please log in or register

Download MetaTrader 5 and visit MQL5.community Code Base
and Trade on the Go!
Prepare for the Championship
Couldn't find the right code? Order it in the Jobs section

This script is for
MetaTrader 4
Download MT 4 - 455 Kb

and Trade on the Go!

Name:
Lot_Volume [ ru | cn ]
Author: Andrey_Z (2008.11.21 08:15)
Downloaded: 1790
Download:
 Lot_Volume.mqh (874 bytes) View

The functuion automatically calculates the lot size from the specified percent of free assets (х%) or uses the fixed lot size ("х" without "%" sign).

We add the function #include <Lot_Volume.mqh> to the program and call it in the necessary place: OrderSend(Symbol, Order Type, Lot_Volume(), Price, 0, Stop, Profit);

If you specify "10%", for example, then the size of the lot will be equal to 10% of free assets, and if you specify just "10" then the size will be equal to 10 lots.

Certainly, the library is not perfect, I wait for your comments.


2 comments  To post a new comment, please log in or register
Jedimedic77:

could you please tell me where in the code do you specify the (10%) i keep getting errors if possible post a syntax example

thanks

Jim


Same problem i'm going through!!!

How do we specify whether in % or just digit...

03.11.2010 10:32 ksrohit2712

could you please tell me where in the code do you specify the (10%) i keep getting errors if possible post a syntax example

thanks

Jim

03.03.2009 23:16 Jedimedic77