Download MetaTrader 5

someone can help me?how do i check new bar?

To add comments, please log in or register
Traders have already contributed more than 300 articles. Write your own one!
Rich Lin
Rich Lin 2014.12.19 03:38 
this is my code.igot some problam when the "new tickets"and"close"Condition was set up in the same time.

will look line this photo.
now,I want add a new code to set . every bars were only trade once in the same bar.
i try many method like timefram , int bars or Bars,but it's not work.
so please give me a hand.  thanks alot
extern double Lots = 1.00;
extern int Periodma = 36 ;
extern int trailing = 100;
extern int StopLoss = 400;
extern int TrailingStop = 500;
extern int Dev = 2;
extern int Tick = 0;
double profit = 0;
extern int Periodma1 = 124 ;
int bars;

int Init()
   bars = Bars;
void OnTick()
  int    cnt,ticket,total;
      Print("bars less than 100");
Carl Schreiber
Carl Schreiber 2014.12.19 09:13  

1) It not enough code!

2) If you are learning to code you should use an example for here and change it - it's faster and you'll face less errors!

To add comments, please log in or register