[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 777

 
RekkeR:
I have several horizontal lines, I need to define quotas between them in different combinations. I am looking for a script or indicator that would do the job. Thank you for your feedback.

I don't program professionally, so I'd be happy to help, but...

 
RekkeR

There are several horizontal lines, I need to determine the quotas between them in different combinations, in principle, at this stage I am quite satisfied with the determination between the two lines, the rest I will do manually. Maybe there is a ready-made script or such an indicator? Thank you for your feedback.

I will give you the ready code, if you need it. There is nothing complicated about it.

//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
{ 
  
  /*
        Скрипт
  ========== Lines_RASST ========

Является дополнением к скрипту Lines_Create. (Скрипт Lines_Create создаёт на графике 2 горизонтальные линии с именами UP_LEVEL и DOWN_LEVEL)

Скрипт Lines_RASST выводит на экран сообщение о том, сколько пунктов расстояние между двумя горизонтальными линиями
    у которых миена UP_LEVEL и DOWN_LEVEL.
    В силу того, что скрипт Lines_RASST имеет задержку в коде, надо не просто кинуть его на график, или не просто сделать
    по скрипту двойной клик, надо ещё сразу сделать дополнительный одинарный клик левой кнопкой мыши по окну графика.
    Только в этом случае надпись, говорящая о расстоянии появится и через 5 секунд исчезнет сама.
    Если скрипт Lines_RASST вызван, а дополнительный клик по окну не сделан, то по прошествии 5 секунд скрипт выгрузится из оперативной
    памяти, и Вы ни чего на экране не увидите, ни какой надписи (почему так сделан терминал я не знаю).


  */
  
  bool fm;
   // --------------- Значения цены на горизонтальных линиях ---------------------------------
  double UpLevelPrice=ObjectGet("UP_LEVEL",OBJPROP_PRICE1);
  double DownLevelPrice=ObjectGet("DOWN_LEVEL",OBJPROP_PRICE1);
// ---------------------------------------------------------------------------------------- 
 //--------- калькулятор расстояний между этими линиями ---------------
  
  int Rasst=(UpLevelPrice-DownLevelPrice)/Point;
  fm=ObjectCreate("DIAPAZON",OBJ_LABEL,0,0,0);
  if(fm==0 || fm==-1){// тут можно вывести сообщение об ошибке}
  fm=ObjectSetText("DIAPAZON","Канал = "+Rasst+" pt.",24,"Verdana",Blue); 
  if(fm==0 || fm==-1){// тут можно вывести сообщение об ошибке}
  fm=ObjectSet("DIAPAZON",OBJPROP_CORNER,0);
  if(fm==0 || fm==-1){// тут можно вывести сообщение об ошибке}
  fm=ObjectSet("DIAPAZON",OBJPROP_XDISTANCE,350);
  if(fm==0 || fm==-1){// тут можно вывести сообщение об ошибке}
  fm=ObjectSet("DIAPAZON",OBJPROP_YDISTANCE,315);
  if(fm==0 || fm==-1){// тут можно вывести сообщение об ошибке}
  // ------------------------------------------------------------------
  Sleep(5000);
  //-------- удаляем надпись с экрана -----------------------------
 fm=ObjectDelete("DIAPAZON");
 if(fm==0 || fm==-1){// тут можно вывести сообщение об ошибке}
}
 
drknn:

It is incorrect because the string double MyKoren(double MyValue=36){ initializes variable MyValue with value = 36. It makes no sense because we pass value = to the DlyaKornya variable into the subroutine .


This is the default... If the function is called like this: double rex=(MyKoren()+1)*100+(MyKoren()+1)*10+MyKoren()+1;

is the answer clear?

 
Sorento:

This is the default... If the function is called like this: double rex=(MyKoren()+1)*100+(MyKoren()+1)*10+MyKoren()+1;

do you get the answer?


I'll repeat it:

... Initializing a variable in it with value = 36 will probably work only when the function is called without specifying parameters.

... Anyway, you'd better not use constructions like double MyKoren(double MyValue=36){ but write double MyKoren(double MyValue){ in such a way that you will wonder why the subroutine does not work as it should.

Please understand that if you use a construct like double MyKoren(double MyValue=36){ followed by a call like your double rex=(MyKoren()+1)... It's a piece of cake to lose control. Especially for a beginner.

 
drknn:


I'll say it again:

... Initialising a variable in it with value = 36 will probably only work if the function is called without parameters.

... Anyway, you'd better not use constructions of double MyKoren(double MyValue=36){ type and write them as they should - double MyKoren(double MyValue){, or else you will wonder why the subroutine does not work as it should.

Please understand that if you use a construct like double MyKoren(double MyValue=36){ followed by a call like your double rex=(MyKoren()+1)... It's a piece of cake to lose control. Especially for a beginner.

)))

But you'll remember the page number.

Or the key will be generated.

;)

This is another thread - I got lost. and please forgive me.

The mail is circling. (c) AS Pushkin

 
drknn:
You shouldn't be posting stolen goods.
What makes you think I stole anything? This indicator is freely available on the internet in mql format. What does it have to do with not posting decompiled indices? I personally have not decompiled anything. I found it, I liked it and asked for an alert. What's the problem?
 

Good afternoon ... Can you tell me how to enable an EA such as Ilan_19 posted here... work on Alpari five digits... installed it and it's not working...

 
Pilligrim:

Good afternoon ... Can you tell me how to enable an EA such as Ilan_19 posted here... work on Alpari five digits... installed it and it's not working...

Not working is an elastic term... What exactly is not working, what is happening, etc., etc.
 
artmedia70:
Not working is an elastic term... What exactly is not working, what is going on, etc. etc.
is not trading...
 

Pilligrim:

doesn't trade...

Neither does he need to trade.