Download MetaTrader 5

please can someone help me to calculate this lot formular....

To add comments, please log in or register
Hundreds of articles will help you to create a trading robot. Come and read them!
chudanever
257
chudanever 2015.07.08 17:34 

please i am looking for a way to get my lot calculation step like this 0.1, 0.2, 0.4, 0.6, 0.8, 0.10  etc

but i fine it had to code out instead i get 0.01, 2.00, 4.00, 6.00, 8.00, 10.00 etc


please can someone help me make it like this === 0.1, 0.2, 0.4, 0.6, 0.8, 0.10 

below is what i have done so far

 

whroeder1
14537
whroeder1 2015.07.08 18:24  
dan100: please can someone help me make it like this === 0.1, 0.2, 0.4, 0.6, 0.8, 0.10
if(lot == 0.1) lot += 0.1; else lot += 0.2;
chudanever
257
chudanever 2015.07.08 18:43  
WHRoeder:

thanks WHRoeder for your quickest response but please which line should i fix the code already am a bit confused

JD4
1101
JD4 2015.07.08 19:05  
Wherever you are trying to increment the lot size in your code.  That is where this line needs to be.  It all depends on where in your code you want the lot size changed.
chudanever
257
chudanever 2015.07.08 19:47  

JD4 but is this code wHRoeder gave me independent of the code i posted early above, because the way i calculate my lot is

 

after  calculating i use the value in my ordersend like  ,

mylot() 

so please make me clear pls

is the code independent of my own code posted?

JD4
1101
JD4 2015.07.08 20:00  

No, the code needs to go within your code, where you are trying to figure out what lot size you want to trade next.  Possibly within the below block of code.

if(Martingale)                       
  {
     if(checkforlosses())              
     {
        lot=NormalizeDouble(lastlot()+Multiplier,0);
     }
     else
     {
        lot=StartLot;                 
     }

I am not very familiar with MQL programming yet, but I am trying to learn.  Basing it on the little I remember from my Java classes, the above advice might be way off as far as where it needs to be.  How you would fit in there might take some experimentation.

chudanever
257
chudanever 2015.07.09 18:42  
thanks wHRoeder you never stop assisting me each time i post for help thanks, i appriciate.jda never forgetting, thanks for your guide.
 
To add comments, please log in or register