Max Lot Size

 

Hello all,

I am in the process of backtesting my EA on MT4. I am using FXCMs MT4 platform. I have deleted the .hst files and downloaded and installed 1M historical price data. I am disconnected from my brokers demo account when I backtest however I am being limited to a maximum lot size of 100.

Why is this? If I am disconnected from my brokers server then I shouldnt be limited?

I have coded my lots to be split if they exceed my brokers MAXLOT, however since I am not connected to the server it will not derrive the information is requires to work. And I do not want to connect to their server as I dont want to use their historical price feed.

Any advice?

 

Since the max lot size is retrieved with MarketInfo() function (which is a function that is strictly working for a known symbol) the info about max lost size is probably written in the symbols.raw file. But since they did not disclose the exact format of the symbols.raw file, this is just a guess work (maybe helps)

crsnape@btinternet.com:
Hello all,

I am in the process of backtesting my EA on MT4. I am using FXCMs MT4 platform. I have deleted the .hst files and downloaded and installed 1M historical price data. I am disconnected from my brokers demo account when I backtest however I am being limited to a maximum lot size of 100.

Why is this? If I am disconnected from my brokers server then I shouldnt be limited?

I have coded my lots to be split if they exceed my brokers MAXLOT, however since I am not connected to the server it will not derrive the information is requires to work. And I do not want to connect to their server as I dont want to use their historical price feed.

Any advice?
 

PS: just found an interesting piece of info :

Q. What is the maximum available lot size with Alpari Direct Pro? A. There is no maximum lot size with Alpari Direct Pro.

Source of info : - Alpari (US)

 

Hi mladen, I've looked in the history file and I have a symbols.raw. It probably got created when I opened the demo account, and its remained after I've removed it.

I have this code: Comment("The max lot size is ", (MarketInfo(Symbol(), MODE_MAXLOT)));

But nothing displays in the chart. Just wondering whether the MAX_LOT can be retrieved from an offline MT4? It probably cant? But if this is the case, then why are my lot sizes capped to 100.0. Its clearly pulling it from somewhere?

 

And what if it has some "default value"?

As I said, since we can not take a peak into the core how it is done, just guessing

crsnape@btinternet.com:
Hi mladen, I've looked in the history file and I have a symbols.raw. It probably got created when I opened the demo account, and its remained after I've removed it.

I have this code: Comment("The max lot size is ", (MarketInfo(Symbol(), MODE_MAXLOT)));

But nothing displays in the chart. Just wondering whether the MAX_LOT can be retrieved from an offline MT4? It probably cant? But if this is the case, then why are my lot sizes capped to 100.0. Its clearly pulling it from somewhere?
 

I mean something like : if max lot seize ==0 then max lot size = 100. And in that case it could limit you that way

 

Or perhaps my code isnt correct? This is it. Does this look OK to you? It attempts to split into several orders if LotsNew is greater than Max.Lot.

int LotsNew = GetLotsLong (SLDistanceLong, DonchianLowM5, Risk);

Print("Lots to be purchased: ", LotsNew);

for (int Split = MathCeil(LotsNew / Max.Lot); Split > 0; Split --)

{

if (Split == 1) double Size = LotsNew;

else {Size = MathCeil (LotsNew / Split / Lot.Step) * Lot.Step; LotsNew -= Size;}

Ticket = OrderSend(Symbol(), OP_BUY, Size, Ask, 3, DonchianLowM5, 0, "EA Opening Buy Order", MagicNumber, 0, Green);

}

 

And this is in there also:

double Lot.Step = MarketInfo(Symbol(), MODE_LOTSTEP); // FXCM = 0.01

double Max.Lot = MarketInfo(Symbol(), MODE_MAXLOT ); // FXCM = 100.00

 

Here is one procedure that splits the order into chunks and saves the chunks into an array (passed by reference). Attaching a simple test indicator too (I used it to test if the procedure works correctly). Once you have the results stored in the array, all you have to do is to loop through the array elements and open an lot size order that is indicated by individual array element

void splitOrder(double& parts[], double targetSize)

{

double maxSize = MarketInfo(Symbol(),MODE_MAXLOT); ArrayResize(parts,0);

int arrSize = 0;

//

//

//

while (targetSize>=maxSize)

{

ArrayResize(parts,arrSize+1);

parts[arrSize] = maxSize;

targetSize -= maxSize;

arrSize++;

}

if (targetSize>0) { ArrayResize(parts,arrSize+1); parts[arrSize] = targetSize; }

}
Files:
_test.mq4  2 kb
Reason: