[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 157

 
sanktum:

pressed twice on the line there was a vertical line in front of 70, pressed Enter the line became blue but the number 70 remained?

Double-click on the desired parameter, enter the desired value and press Enter
 
But I double click on the right papameter where the number 70, a vertical line appears in front of 70, I type 10 in front of 70, I press Enter and the result is 1070 , but I just need 10?
 

Good evening, please advise how to write a condition that does not open buy (sell) if an order(s) is(are) opened in the opposite direction.

I would appreciate it.

 
novator:

Good evening, please advise how to write a condition that does not open buy (sell) if an order(s) is(are) opened in the opposite direction.

I would appreciate it.


check this function on the web site

GetTypeLastOpenPos()

 

This one is better:

//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 06.03.2008                                                     |
//|  Описание : Возвращает флаг существования позиций                          |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента   (""   - любой символ,                   |
//|                                     NULL - текущий символ)                 |
//|    op - операция                   (-1   - любая позиция)                  |
//|    mn - MagicNumber                (-1   - любой магик)                    |
//|    ot - время открытия             ( 0   - любое время открытия)           |
//+----------------------------------------------------------------------------+
bool ExistPositions(string sy="", int op=-1, int mn=-1, datetime ot=0) {
  int i, k=OrdersTotal();
 
  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      if (OrderSymbol()==sy || sy=="") {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (op<0 || OrderType()==op) {
            if (mn<0 || OrderMagicNumber()==mn) {
              if (ot<=OrderOpenTime()) return(True);
            }
          }
        }
      }
    }
  }
  return(False);
}
 

Question. I'm trying to pass a bar shift in history via iCustom buffer.

Examples PRIOR to date (passing int of course).

#property indicator_chart_window
//---
extern string __History_method___   = "Set a date for the analysis"; 
extern bool   dateshift             = false;
extern bool   dataLine              = false;
int init()
  {
//---- indicators
   
   return(0);
  }
int deinit()
  {
//----
   ObjectDelete("TL2");
//----
   return(0);
  }
int start()   {    int DataCustom;    datetime DateShift; //----    if (Bars<1) return(-1);   DataCustom = iCustom(Symbol(), 0, "History", 0, 0, 1);    DateShift  = iTime(Symbol(), 0, DataCustom);    if (dataLine==true)    {    ObjectCreate("TL2", OBJ_VLINE, 0, DateShift), 0);    ObjectSet("TL2", OBJPROP_TIME1, DateShift);    ObjectSet("TL2", OBJPROP_COLOR, Red);    ObjectSet("TL2", OBJPROP_STYLE, 2);    }    return(0);   } ПЕРЕДАТЧИК
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1  Green
extern string __History_method___   = "Set a date for the analysis"; 
extern string DateShift             = "14.02.2013 07:00";
extern bool   dataLine              = false;
//----
double TiBuffer[];

int init()
  {
//---- indicators
SetIndexBuffer(0,TiBuffer);
IndicatorDigits(0);
SetIndexEmptyValue(0,0.0);
//----
   return(0);
  }

int deinit()
  {
//----
   ObjectDelete("TL");
//----
   return(0);
  }

int start()
  {
   int historybar  = iBarShift(Symbol(), 0, StrToTime(DateShift), false);
   TiBuffer[1] = historybar;
//----   
   if (dataLine==true)
   {
   ObjectCreate("TL", OBJ_VLINE, 0, iTime(Symbol(), 0, historybar), 0);
   ObjectSet("TL", OBJPROP_TIME1, iTime(Symbol(), 0, historybar));
   ObjectSet("TL", OBJPROP_COLOR, Red);
   ObjectSet("TL", OBJPROP_STYLE, 2);
   }
//----   
   return(0);
  }
//+------------------------------------------------------------------+
ВОПРОС! Передача даты идет ТОЛЬКО по ранее установленной цифре! Когда дату меняю, например на 12.2.2013 передача по буферу идет все равно  14.02.2013. Можно ли решить проблему. Идея таким образом объединить несколько индикаторов, для движения по истории.
 
YOUNGA,tara thank you for your help
 
I can't change the max drawdown in the strategy tester in the optimization section, but people that I bought the Expert Advisor have changed this parameter in the terminal, and I was advised to contact you, is it a problem?
 
sanktum:
I can't change the max drawdown in the strategy tester in the optimization section, but people that I bought the Expert Advisor have changed this parameter in the terminal, and I was advised to contact you, is it a problem?
Just click once on 70 and then enter 10.
 
tara:
Click once on 70 and enter 10.


I've never been able to change anything at all. Checked or unchecked, the old value comes back and that's it...