Who knows where to find a robot that will open trades when opening a candle.
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
nektomk
only time_bar is not static and not inside the method, in general it is better to take an application library,get used to a good one 🙂
the above code is correct, but only for the tester, to quickly check the idea.
in reality, it gives a bug that you will catch later, about restarts of the adviser and the terminal.
iks_
void OpenPosition(void)
  {
  static datetime time_bar = 0;
  datetime _time_bar = iTime(_Symbol, PERIOD_CURRENT, 0);
  if(time_bar == _time_bar)
      return;
  time_bar = _time_bar;
//---
  }