Weekend evening - page 42

 
Vladimir Baskakov:
Yes, what is the question?
How are they counted.
 
Alexey Viktorov:
How they count.
And what, I know, is there anything you want from me?
 
Vladimir Baskakov:
And what, I know, is what you want from me?

I don't need anything at all. It was just a question. Without any trick or hint. If OsMA is the difference between the histogram and the MACD signal line, then why bother taking two indicators when it's easier to use arithmetic.

 
Vladimir Karputov:

When you find it let me know ...

https://www.mql5.com/ru/code/26580
Thank you @AlexeyViktorov
MACD OsMA
MACD OsMA
  • www.mql5.com
Индикаторы MACD и OsMA в одном окне
 

Hello Vladimir, could you please tell me if it is possible to implement this in an indicator or in an Expert Advisor ?
I'd like to have an object with a name that would move behind the price.

input ushort   InpTrailingStop      = 25;          // Trailing Stop (min distance from price to Stop Loss, in pips
input ushort   InpTrailingStep      = 5;           // Trailing Step, in pips (1.00045-1.00055=1 pips)

Photo by

 
Aleksandr Klapatyuk:

Hello Vladimir, could you please tell me if it is possible to implement in an indicator or in an Expert Advisor ?
I would like to see an indicator that would move after the price.


Yes, you can. You need two parameters: how often distance should be checked (and tightened accordingly) and the step of tightening (analog of trailing)

 
Vladimir Karputov:

Yes, you can. Two parameters are needed: how often to check the distance (and pull up accordingly) and the pull up pitch (analogue of trailing)

Thank you for your reply. And could you - implement something like this ? Thank you in advance!

 
Aleksandr Klapatyuk:

Thank you for the answer. Could you implement something like this? Thank you in advance.

Not right away. Probably in the evening. The main concept is that there are two variables, which are responsible for price levels, declared at global program level of Expert Advisor (in simple terms - in the "hat"). These variables are calculated and the lines are moved on the basis of these variables. In other words, lines are of minor importance only for displaying information.

 
Vladimir Karputov:

Not right away. Probably by the evening. The main concept here is that the price levels are determined by two variables declared at the global program level of the EA (in the 'header'). These variables are calculated and the lines are moved on the basis of these variables. In other words, lines are secondary, they are used only for displaying information.

Thank you for implementing it.

 

I've been working all day and haven't been able to do anything.

I don't really know where to dig. the script: - The name of the object is sticky to the current price.

//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2018, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#property script_show_inputs
//--- входные параметры скрипта
input string   InpFont              = "Text"; //
input ushort   InpTrailingStop      = 25;     // Trailing Stop
//---
datetime time    = 0;
double   price   = 0;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   if(!time)
      time=TimeCurrent();
   if(!price)
      price=SymbolInfoDouble(Symbol(),SYMBOL_BID);
   if(!ObjectMove(0,InpFont,0,time,price))
      return;
//--- перерисуем график
   ChartRedraw();
// задержка в 0.05 секунды
   Sleep(50);
  }
//+------------------------------------------------------------------+