needed help !!!! CODE!!!

 
hello again, i trying to use the goldminer 1 and 2 indicators, as EA, WELL i got the EA running just fine but the problem is that when i get the signal from the GM1 AND GM2 to buy or sell it does it on the next bar not on the bar that the signal was trigger, and stay open unitl the EA closed it.... what i want if u can help me, is to open the order when the signal is trigger and to close the current order when the reverse signal is trigger and open the reversal signal order as well . here is the code thanks!!!!!!
 
chumpyto:
hello again, i trying to use the goldminer 1 and 2 indicators, as EA, WELL i got the EA running just fine but the problem is that when i get the signal from the GM1 AND GM2 to buy or sell it does it on the next bar not on the bar that the signal was trigger, and stay open unitl the EA closed it.... what i want if u can help me, is to open the order when the signal is trigger and to close the current order when the reverse signal is trigger and open the reversal signal order as well . here is the code thanks!!!!!!


Chumpyto

You need to post the .mq4 file.

 
CountingMan:


Chumpyto

You need to post the .mq4 file.


ok her is the file mq4, sorry about that i dont know why i put the ex4 file, well,thank you for help!!!
 
please can anybody take a look to the code and help me out, thank so much!!!
 
please anybody would so kind of helping a noob ....... thanks !!!!1
 
      if(BarCount!=Bars){TradePerBar=0;BarCount=Bars;}

Bars is not reliable (once you reach max bars in chart, Bars does not change.) Volume is not reliable. Use Time[0]

    static datetime Time0;  bool    newBar  = Time0 < Time[0];
    if (newBar){                              Time0 = Time[0];
       ...


You shouldn't be looking at iCustom(... 0) as indicators can change rapidly at the beginning of a bar. On a newBar look at iCustom(...1).

 
thank for the reply!!!! i will try that !!!
 
ok is working now, but still i cant close the order when a TRUE signal is display, now is open the trade on the bar that the signal was trigger, but is not closing it when it gets the reverse signal, can u give some pointers//? thanks?