only trades alone

 

can anybody give me an idea why this EA only trade when its the only EA on a chart...even if I choose a different pair if there is more than 1 EA it doesnt take trades, but if its alone it takes trades.


it has a magic number and a comment...so I thought this shouldn't happen.

I havnt posted the custom indy here, but hopefully you wont need it to see if there is a code problem.


thanx

Files:
15mlgl.11.mq4  6 kb
 

really an ingenious idea to disable the display of errors and then wondering what may be the reason for no trading

if(ticket>0) {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) {
              // Print("BUY order opened : ",OrderOpenPrice());
            }
         } else {
           // Print("Error opening BUY order : ",GetLastError());
         }
 
meikel:

really an ingenious idea to disable the display of errors and then wondering what may be the reason for no trading


I did that after it traded no problem...when there are 2 EA's on the chart the EA does not trade at all and then the errors do not show up at all even if they are enabled.

 
any body got an idea on this? I am out of ideas. :(
 

I thought you could only have one EA per chart?

  if(Volume[0]==1 && total==0){
      if(AccountFreeMargin()<(1000*LotSize)) {
          //...

I has been shown in another thread that Volume[] can jump by more than one so this may be unreliable. The following always works.

static datetime Time.newBar;	bool newBar	= (Time[0] > Time.newBar);
if (newBar) {				           Time.newBar = Time[0];
   //...


init() {
   Time.newBar = Time[0] + 60 * Period() - 1; // Comment out if you want it to 
                                              // trade on initial start up.
}
 
WHRoeder:

I thought you could only have one EA per chart?

I has been shown in another thread that Volume[] can jump by more than one so this may be unreliable. The following always works.

sorry I didnt make myself clear properly, I meant per pair... you can have multiple EA's per pair as long as they are on separate charts of the same pair and have magic numbers/comments etc.


thanx for the volume help.


cheers

Reason: