[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 843

 
chief2000:

An idea has come up - since this was only started for a tester, you could (where appropriate) do the following:

Thank you!

Don't get confused, or you may end up with a situation where you have to execute the code of this function following the interrupted operation after the end of the loop by break,
and you will crash out of the function on return.
IMHO - you should not do it for tester, but for real...
 
artmedia70:
Do not get confused, otherwise you may get a situation when after the loop is broken by break you will have to execute the code of this function following the interrupted operation,
and you will completely drop out of the function by return.
IMHO - you have to do it not for tester but for real...

Of course, we would have to look at each case individually.

But the idea of this case is to add more pessimism to the tests (as it often happens in the real world).

We'll have to do tests before and after the change, and then we'll see what's what :)

 

I have a question for gurus who know indicators well:

Is there an indicator that on any given time frame (week, month, year or two)

that shows the range of the high-low and its difference for a given currency pair ?

 

Folks, what function can be used to add a description (comment) to graphical objects like VLINE, HLINE, TREND LINE?

To make it look like this:


 
Noterday:

Folks, what function can be used to add a description (comment) to graphical objects like VLINE, HLINE, TREND LINE ?

To make it look like this:


and the question of whether it's even possible isn't important?
 

the question is how to make it possible to reset the data on this block

//+----------------------------------------------------------------------------+
//|  Описание : Возвращает размер лота последней закрытой позиции или -1       |
//+----------------------------------------------------------------------------+
double GetLotLastClosePos(string sy="", int op=-1, int mn=-1) {
  datetime o;
  double   l=-1;
  int      i, k=OrdersHistoryTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) {
      if (OrderSymbol()==sy || sy=="") {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (op<0 || OrderType()==op) {
            if (mn<0 || OrderMagicNumber()==mn) {
              if (o<OrderCloseTime()) {
                o=OrderCloseTime();
                l=OrderLots();
              }
            }
          }
        }
      }
    }
  }
  return(l);
}

after request

double Lots=GetLotLastClosePos("GBPJPY", OP_BUY);
  if (Lots==1)
{
OpenPosition("GBPJPY", OP_SELL, 1, pa-40*po,pa+40*po);
   }
so it doesn't reopen
 
geneb:

an indicator which on any given time interval ... would show the high-low range and their difference for a given currency pair ?

MaxValues AverageRange scripts
 
FoxUA:

the question is how to make it possible to reset the data on this block

after request

so it does not reopen
bool IsOpenPos = false; // где-то в начале, например, в init()
double Lots=GetLotLastClosePos("GBPJPY", OP_BUY);
  if (Lots==1 && !IsOpenPos)
{
   OpenPosition("GBPJPY", OP_SELL, 1, pa-40*po,pa+40*po);
   IsOpenPos = true;  
}
ps. "do' is NOT spelt correctly - it's 'do'.
 
abolk:
ps. "do" is NOT spelt correctly - the correct spelling is "make".
))))))))))) Incorrect is spelled with an inflection.
 
abolk:
ps. "do" is NOT spelled correctly - it's "do".

thanks