Multiple Orders, same chart

 

Hello everyone again!


I am currently trying to figure out how to make my expert advisor open multiple orders at the same time, i.e. buying 1 contract, and then when account balance is high enough, opening two contracts at one price. This is all intended to be done on one chart, one currency.


Is this not possible?

 
Darko wrote >>

Hello everyone again!

I am currently trying to figure out how to make my expert advisor open multiple orders at the same time, i.e. buying 1 contract, and then when account balance is high enough, opening two contracts at one price. This is all intended to be done on one chart, one currency.

Is this not possible?

Sure it is possible; basically you need to tweak this:

lots = AccountFreeMargin()/MarketInfo(Symbol(),MODE_MARGINREQUIRED)

this will tell you exactly how many lots you can buy at any time, you will need to round to whole numbers if you don't wish

to trade part lots, or use something like..... if(lots>2){...go ahead and buy/sell 2 lots...}

HTH

Keith