[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 408

 
costy_:
Thank you.
 
Roman.:


Copies of the terminals... :-)

Each has its own unique trading account.

You mean you have to run several terminals at the same time and log in with different usernames in each one?
 
LOA:

Yeah.... "Exhaustive" answer. Every event has to have a reason. Professionals, encountering some problems know what to pay attention to. I have looked through the algorithm several times but cannot find the cause. So I ask the pros for advice - what could be the cause?
Well, if you can not do it yourself, the algorithm as a whole does not hurt, in the given lines apparent flaws are not. The remark is entirely on point.
 
costy_:

... indicator.

int start(){
  double Val=iCustom(NULL, 0, "HMR MULTI Indicator",0,0);   
  Alert(Val);
}

try the "gut feeling" method with an empty Expert Advisor,

Check in the indicator for ObjectCreate to find its subwindow (or why draw it IF TESTING OR OPTIMIZING)

if(IsTesting()||IsOptimization())флаг_Канады_не_рисовать_obj=true;          //проверяем надо ли рисовать (в ините ему место через статик переменную)
if(!флаг_Канады_не_рисовать_obj){                                           //запрет отрисовки объектов ели оптимизация или тестирование
ObjectCreate(........................);
}


I tried an empty Expert Advisor, Alert is displayed normally, but in the indicator ObjectCreate has this view:

#property indicator_separate_window
#property indicator_buffers 8
#property indicator_color1 Yellow
#property indicator_color2 Aqua
#property indicator_color3 Blue
#property indicator_color4 Red
#property indicator_color5 White
#property indicator_color6 Magenta
#property indicator_color7 Lime
#property indicator_color8 Indigo

extern string S1 = "EURUSD";  
extern string S2 = "EURJPY";  
extern string S3 = "EURCAD";  
extern string S4 = "AUDUSD";  
extern string S5 = "GBPUSD";  
extern string S6 = "USDJPY";  
extern string S7 = "USDCHF";  
extern string S8 = "USDCAD";
//переменные объявляем сразу,чтобы постоянно не создавались (оптимизация)
double Buff1[],Buff2[],Buff3[],Buff4[],Buff5[],Buff6[],Buff7[],Buff8[],
       x1,x2,x3,x4,x5,x6,x7,x8;
int    BarsOnScreen,LeftBar,RightBar,i;
bool   _init;
string name = "HMR MULTI Indicator";     
//+------------------------------------------------------------------+
int init()
  {
   _init = false;
   IndicatorBuffers(8);
   //Если символ графика совпадает с символом прорисовки,нарисуем линию толще
   if (Symbol()==S1) i=3;else i=1;
   SetIndexStyle (0,DRAW_LINE,STYLE_SOLID,i,indicator_color1); SetIndexBuffer(0,Buff1);
   if (Symbol()==S2) i=3;else i=1;
   SetIndexStyle (1,DRAW_LINE,STYLE_SOLID,i,indicator_color2); SetIndexBuffer(1,Buff2);
   if (Symbol()==S3) i=3;else i=1;
   SetIndexStyle (2,DRAW_LINE,STYLE_SOLID,i,indicator_color3); SetIndexBuffer(2,Buff3);
   if (Symbol()==S4) i=3;else i=1;
   SetIndexStyle (3,DRAW_LINE,STYLE_SOLID,i,indicator_color4); SetIndexBuffer(3,Buff4);
   if (Symbol()==S5) i=3;else i=1;
   SetIndexStyle (4,DRAW_LINE,STYLE_SOLID,i,indicator_color5); SetIndexBuffer(4,Buff5);
   if (Symbol()==S6) i=3;else i=1;
   SetIndexStyle (5,DRAW_LINE,STYLE_SOLID,i,indicator_color6); SetIndexBuffer(5,Buff6);
   if (Symbol()==S7) i=3;else i=1;
   SetIndexStyle (6,DRAW_LINE,STYLE_SOLID,i,indicator_color7); SetIndexBuffer(6,Buff7);
   if (Symbol()==S8) i=3;else i=1;
   SetIndexStyle (7,DRAW_LINE,STYLE_SOLID,i,indicator_color8); SetIndexBuffer(7,Buff8);
  return(0);
  }
//+------------------------------------------------------------------+
int deinit()
  {
  ObjectsDeleteAll();  
  return(0);
  }
//+------------------------------------------------------------------+
int start()
{
      if (!_init) MyInit();
      BarsOnScreen = WindowBarsPerChart()+1;
      LeftBar = WindowFirstVisibleBar();
      RightBar = LeftBar-BarsOnScreen;
      if (RightBar<0) RightBar=0;
       //Проверяем есть ли история баров для прорисовки
      if (LeftBar>iBars(S1,0) || LeftBar>iBars(S2,0) || LeftBar>iBars(S3,0) || LeftBar>iBars(S4,0) ||
          LeftBar>iBars(S5,0) || LeftBar>iBars(S6,0) || LeftBar>iBars(S7,0) || LeftBar>iBars(S8,0)) return;
       //Выносим из цикла,чтобы уменьшить расчёты (оптимизация)
       x1=iClose(S1,0,iHighest(S1,0,MODE_CLOSE,BarsOnScreen,RightBar));
       x2=iClose(S2,0,iHighest(S2,0,MODE_CLOSE,BarsOnScreen,RightBar));
       x3=iClose(S3,0,iHighest(S3,0,MODE_CLOSE,BarsOnScreen,RightBar));  
       x4=iClose(S4,0,iHighest(S4,0,MODE_CLOSE,BarsOnScreen,RightBar));
       x5=iClose(S5,0,iHighest(S5,0,MODE_CLOSE,BarsOnScreen,RightBar));
       x6=iClose(S6,0,iHighest(S6,0,MODE_CLOSE,BarsOnScreen,RightBar));
       x7=iClose(S7,0,iHighest(S7,0,MODE_CLOSE,BarsOnScreen,RightBar));
       x8=iClose(S8,0,iHighest(S8,0,MODE_CLOSE,BarsOnScreen,RightBar));
       for(i=RightBar; i<LeftBar; i++)
        {       
         Buff1[i] = iClose(S1,0, i)/x1;
         Buff2[i] = iClose(S2,0, i)/x2;
         Buff3[i] = iClose(S3,0, i)/x3;  
         Buff4[i] = iClose(S4,0, i)/x4;
         Buff5[i] = iClose(S5,0, i)/x5;
         Buff6[i] = iClose(S6,0, i)/x6;
         Buff7[i] = iClose(S7,0, i)/x7;
         Buff8[i] = iClose(S8,0, i)/x8;
        }
return(0);
}   
//+------------------------------------------------------------------+
void MyInit ()
{
   //Подменяем имя индикатора чтобы получить уникальный номер окна
   string label = GetTickCount();
   IndicatorShortName(label);
   int win = WindowFind(label);
   //Восстанавливаем имя индикатора
   IndicatorShortName(name);
   //---- labels    
   ObjectCreate("L1"+label,OBJ_LABEL,win,0,0,0,0);
   ObjectSet("L1"+label,OBJPROP_XDISTANCE,10);
   ObjectSet("L1"+label,OBJPROP_YDISTANCE,12);
   ObjectSetText("L1"+label,S1,10,"Tahoma",indicator_color1);
   ObjectCreate("L2"+label,OBJ_LABEL,win,0,0,0,0);
   ObjectSet("L2"+label,OBJPROP_XDISTANCE,10);
   ObjectSet("L2"+label,OBJPROP_YDISTANCE,24);
   ObjectSetText("L2"+label,S2,10,"Tahoma",indicator_color2);
   ObjectCreate("L3"+label,OBJ_LABEL,win,0,0,0,0);
   ObjectSet("L3"+label,OBJPROP_XDISTANCE,10);
   ObjectSet("L3"+label,OBJPROP_YDISTANCE,36);
   ObjectSetText("L3"+label,S3,10,"Tahoma",indicator_color3);
   ObjectCreate("L4"+label,OBJ_LABEL,win,0,0,0,0);
   ObjectSet("L4"+label,OBJPROP_XDISTANCE,10);
   ObjectSet("L4"+label,OBJPROP_YDISTANCE,48);
   ObjectSetText("L4"+label,S4,10,"Tahoma",indicator_color4);
   ObjectCreate("L5"+label,OBJ_LABEL,win,0,0,0,0);
   ObjectSet("L5"+label,OBJPROP_XDISTANCE,10);
   ObjectSet("L5"+label,OBJPROP_YDISTANCE,60);
   ObjectSetText("L5"+label,S5,10,"Tahoma",indicator_color5);   
   ObjectCreate("L6"+label,OBJ_LABEL,win,0,0,0,0);
   ObjectSet("L6"+label,OBJPROP_XDISTANCE,10);
   ObjectSet("L6"+label,OBJPROP_YDISTANCE,72);
   ObjectSetText("L6"+label,S6,10,"Tahoma",indicator_color6);
   ObjectCreate("L7"+label,OBJ_LABEL,win,0,0,0,0);
   ObjectSet("L7"+label,OBJPROP_XDISTANCE,10);
   ObjectSet("L7"+label,OBJPROP_YDISTANCE,84);
   ObjectSetText("L7"+label,S7,10,"Tahoma",indicator_color7);
   ObjectCreate("L8"+label,OBJ_LABEL,win,0,0,0,0);
   ObjectSet("L8"+label,OBJPROP_XDISTANCE,10);
   ObjectSet("L8"+label,OBJPROP_YDISTANCE,96);
   ObjectSetText("L8"+label,S8,10,"Tahoma",indicator_color8);
   WindowRedraw();
   _init = true;
}

What should I change here...?

 
kolyango:


I tried an empty EA, Alert is displayed ok, but in the indicatorObjectCreate hasthis view:

What needs to be changed here...?

the misalignment is ensured.

iClose(S1,0,iHighest(S1,0,MODE_CLOSE,BarsOnScreen,iBarShift(S1,0,Time[RightBar])));

and you have

iClose(S1,0,iHighest(S1,0,MODE_CLOSE,BarsOnScreen,RightBar))

shift in time but not in bars

realization all in one window is not good (though new year garlands))

and it takes so much time )) tutz

Files:
xxx.mq4  7 kb
 
gara:

Hi all, question for professionals:

Please elaborate on how MT4 works.

My vision:

Terminal is running, Internet is connected, in market overview some instruments are running, some charts are open from them. Let's consider one instrument that has a chart open, let's say it ticked back and forth and the bar closed. The moment is not clear:

Does the last formed bar that I see in my chart correspond to the bar on the broker's side, because a part of ticks could be missed or is there full synchronization with the arrival of each tick?

How often is my history synchronized with the broker's history?


I dare to repeat the question
 
gara:
Dare to repeat the question
gara The terminal is synchronised every tick. There can be several ticks per second. It is only out of sync if the connection is lost. In this case, when communication reappears, the missed ticks are loaded.
 
igid:
So you have to start several terminals at the same time and log in with different logins in each one?

Exactly. It is easier not even to install terminals from scratch, but to copy the existing one with already available settings into folders, e.g. 1,2,3,4...100

And you have to press "Open Account" in each terminal and simultaneously start the Expert Advisor with different settings, which you want to check and see in a month or two, which settings are the best.

 

Can you advise who has been using the Alpari terminal? I run an Expert Advisor for 50 currency pairs, but it keeps missing a tick, even for pending orders. I have a slip set up.

I also get error 4066, no symbol in market overview window, although it is there.

Is it such a glitchy server? At another broker even with a fraction of such problems I did not face

 

Good afternoon everyone,

I'm a complete novice at programming and my robot makes only 2 trades a week,

But can you tell me how (! really tired to search!) to change colour of line of moving average (I'm using standard iMa) on chart?

Example code: FixEma= iMA (NULL,0,fix,0, MODE_EMA, PRICE_LOW,0);

They are red, in fact (I have 6 of them) and after each test I have to paint the chart manually (I'm like that...). I don't want to rewrite it.

Maybe there is a standard command?

Don't judge strictly, I'm just learning...

Reason: