On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - page 2

 
zzuegg:

Addon:

The common 4/5 digit modification will also fail.

A possible modification would be:

This code will fail at Gold and Silver. Still no bulletproof solutions for pip/subpip modifications :(

Why Gold and Silver?
 
Gold and silver are 2 digts but subpip streams
 
I define the number of digits as
//define coefficient
if (Digits ==2 || Digits ==4) {k = 10;}   //broker 4Digit
if (Digits ==3 || Digits ==5) {k = 1;}    //broker 5Digit

//then
sl=NormalizeDouble(sl*point/k,Digits);
tp=NormalizeDouble(tp*point/k,Digits);
 

Hi,

I have created a robo where I am using the lot size of 0.01 as fixed. But despite of that, it is taking trades with 0.1 lot.

Please suggest, what could be the reason.

Thanks

Vinayak

 
Vinayak Aggarwal #I have created a robo where I am using the lot size of 0.01 as fixed. But despite of that, it is taking trades with 0.1 lot.

If your EA is set to use 0.01 lots but it's opening trades with 0.1, a few things could be happening:

  1. Your broker might not allow 0.01 lots; some only allow 0.1 as the minimum.
  2. There might be a part of your code that changes the lot size without you noticing.
  3. Check the EA settings before running it; maybe it's using 0.1 because of a saved input.
 

Hi Miguel,

I checked the code and input parameters.

Input parameter value is set to 0.01 and the same I am using when trading.

Strangely, some trades get executed for 0.01 volume also, while most of them are of 0.1

In my previous robo for same symbol, I had been getting trades of 0.01 only. Also for this robo, in tester, it was taking trades for 0.01 only, but in live demo, I am getting trades most trades of 0.1 and few of 0.01.

The behavior is strange and I have checked the code several times for the possible reason, but unable to understand.

Regards

Vinayak

 
Vinayak Aggarwal #:

In this case, it seems clear that the issue lies within the code itself, most likely due to improper normalization of lot sizes or other critical calculations.

I recommend reviewing the code thoroughly and adding Print() statements at each key step to ensure the EA is processing everything as expected.

The fact that the error occurs randomly is often a strong indication of a logical flaw in the implementation.