Increment lots by 0.01 after each order. Need your help..

 

Hi you all,

My EA works best when I increment the lots by 0.01 by multiplier of 2 after each order. But, it is to danger when market are one side ranging and may blow out my account in blinks an eye..

For your info, I am new to MQL4, there may be a better way, but this is all I can think off. The following code works fine with the strategy tester, but I have noticed that when I start the EA on the demo account, the lots does not increment with minimal increment like 0.01, 0.02, 0.03, 0.04 and so on? How to make it possible?

Your help is needed and very appreciated. Thanks.

Below are my EA coding for your reference.

 
find out
MarketInfo(Symbol(),MODE_MINLOT)
&
MarketInfo(Symbol(),MODE_LOTSTEP)

or use

GetLastError()

ho & BTW even u start with 0.01 u need a lot of money to not blow your account

 
qjol:
find out
&

or use

ho & BTW even u start with 0.01 u need a lot of money to not blow your account



Thanks qjol for your respond.. But, how to implement this code that you are mentioned above in my EA?

If y're don't mind, may you implement that code into my EA?

Your support is very needed..

Thanks..

 

The way you've coded it, it seems that you want it to go 0.01, 0.02, 0.02, 0.04 or at least that's what I've made of it. There is a simpler way:

int buycount; 
  for (y = 0; y < OrdersTotal(); y++)
   {
      OrderSelect (y, SELECT_BY_POS, MODE_TRADES);
      if ((OrderMagicNumber() != magic) || (OrderType()!=OP_BUY)) { continue; }
      buycount++;  
   }
lot2 = lot*MathPow(2,MathFloor(buycount/2));

That should give you 0.01, 0.02, 0.02, 0.04. See if that's any help.

 
heelflip43:

The way you've coded it, it seems that you want it to go 0.01, 0.02, 0.02, 0.04 or at least that's what I've made of it. There is a simpler way:

That should give you 0.01, 0.02, 0.02, 0.04. See if that's any help.


Hmm.. Thanks for your help heelflip43..

I'm very appreciated it..

Maybe I'm need some little revise.. BTW, thanks again..

 

Доброго времени суток уважаемые форумчане!

Меня зовут Герман, мне 23 года, я являюсь трейдером компании "Инстафорекс"

Помогите в поиске нужного скрипта! Скрипт нужен для сетки отложенных ордеров.

Reason: