Can't change lot size in expert advisor

To add comments, please log in or register
indigo79
294
indigo79  

Hi there,

I tried to write my first EA today and everything seemed to work ok apart from that I wasn't able to specify a lot size for orders greater than 0.1 on most symbols.

I'm using the following code to open a buy:

 trade.Buy( 0.1,NULL,Ask,Ask*0.992,Ask*1.006,NULL );

where trade is a CTrade object. When I specify lot(volume) size of 1.0 the EA does not make any deals when I run it in the strategy tester on symbols such as EURUSD.

Please advise,

Many thanks in advance,

Michael.

Guufuj Forex
147
Guufuj Forex  
indigo79:

Hi there,

I tried to write my first EA today and everything seemed to work ok apart from that I wasn't able to specify a lot size for orders greater than 0.1 on most symbols.

I'm using the following code to open a buy:

 trade.Buy( 0.1,NULL,Ask,Ask*0.992,Ask*1.006,NULL );

where trade is a CTrade object. When I specify lot(volume) size of 1.0 the EA does not make any deals when I run it in the strategy tester on symbols such as EURUSD.

Please advise,

Many thanks in advance,

Michael.

Post the code here
To add comments, please log in or register