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

 
AndEv:

Please help in solving a small geometric problem. There is a line with coordinates p1 and p2 (shown in red in the picture). I need to find the coordinate of p3, which is 38.2% of the coordinate of p2. I have done the following:

if(p2>p1) p3=p2-(p2-p1)*0.382; true for the top of the figure

if(p1>p2) p3= p2+(p1-p2)*0.382; true for the lower part of the figure

Is there any way to write this in one equation without the "if" ?

I once made a function that calculates all the Fibo levels using two points - zero Fibo and 23.6 Fibo. You set these two levels and the function writes the rest of them in global variables.

That's about it:


It's a bit different to what you need, but in case...

This is a function, remade to calculate the level of 38.2 fba on two given levels - zero fba (p1) and 23.6 fba (p2):

//+----------------------------------------------------------------------------+
double  CalcFiboLevel(double p1, double p2)   // Рассчитывает уровни Фибы по нулевому и 23.6 значениям цен
{
   double A2,A3,A4,B2,B3,p3;
   
   A2 = 0;                                      // Уровни фибы  
   A3 = 23.6;
   A4 = 38.2;
   B2 = p1;                                     // Цена нулевого уровня фибы (p1)
   B3 = p2;                                     // Цена уровня 23.6 фибы (p2)
   p3 = ((B3-B2)*(A4-A2)+(A3-A2)*B2)/(A3-A2);
   
   return(p3);                                  // ((B3-B2)*(A4-A2)+(A3-A2)*B2)/(A3-A2)
}
//+----------------------------------------------------------------------------+

Maybe you can do something for yourself on the basis of...

 

Guys, please help! Perhaps someone has some thoughts on this...

IN10TION NewsReader indicator.

If the signal is Market.TdOpen && Market.Price.DOWN, then sell

If the signal is Market.TdOpen && Market.Price.UP, buy

What can I do? I tried to use iCustom but it does not work!


extern bool Market.TdOpen = TRUE;
extern color Market.TdOpen.Color = Red;
extern bool Market.TdFibo = TRUE;
extern color Market.TdFibo.Color = C'0x00,0x32,0x00';
extern color Market.Price.UP = Lime;
extern color Market.Price.DOWN = Red;
extern bool Market.Price.Guide = TRUE;

 
Top2n:

Guys, please help! Perhaps someone has some thoughts on this...

IN10TION NewsReader indicator.

If the signal is Market.TdOpen && Market.Price.DOWN, then sell

If the signal is Market.TdOpen && Market.Price.UP, buy

What can I do? I tried to use iCustom but it does not work!


How many it is possible? Well, I tried to look through the inductor in the trailer. My terminal crashes from it.

Look in the data window what values take the buffers of this indicator and decide there. Either it draws objects - look for these objects and take data from them.

 
artmedia70:

How many times? So I tried to look at the turkey in the trailer. My terminal crashes from it.

See in the data window what values this turret buffers take, decide there. Either it draws objects - look for these objects and take data from them.

Is it possible to take data from the indicator only through iCustom?
 
Top2n:

Is it possible to take data from the indicator only through iCustom?
If it is a custom indicator and writes its data in its buffers, then yes, via iCustom().
If it displays objects on the chart and does not use buffers, the data can be taken from these objects.
 
Top2n:

Is it possible to take data from an indicator only through iCustom?

Yes, but not every iCustom is amenable, + it's also possible for experimentation, if you have the code of an indicator - punch it into the body of your owl and go ahead.
 
+ pass the conditions to the global variables. The advisor polls the GV. The unkillable benefit of GV is the compound variable name, which can be used to make loops and dissect.
 
Thank you!)
 

Guys, tell me - so, can you give me a quick, on the fingers - I might...:-), understand.

I'm currently in the process of optimising a few owl parameters. If there is any possibility in Exel (apparently, there is not , or where (on what)? can) to draw at once multidimensional plots from given values of parameters in the form of mountains, displaying clusters of values of this or that optimized parameter, to then make a cut with plane and select the flat variants of their values.

 

Very often, working on the same TF, a design is used:

int start()
{
   datetime time = Time[0];
   if(prevtime == time)return(0);
   prevtime = time;

 //.........
 // все операции советника
 //.........

 return(0);
}

Question:

Isn't such an input code an obstacle for correct optimization of parameters, including SL and TP?

It seems to me that an EA working, say, on H1 and optimized/tested in the mode "by opening price" on H1 will not correctly react to the set SL and TP,

Since an EA only sees a chart once an hour, it is not able to correctly execute Stop orders, i.e. at their crossing points.

............................

As an example https://www.mql5.com/ru/code/9386, where only one parameter (SL) is optimised.

There, in PS, the author writes:

The Expert Advisor uses the model by bar opening prices. There is no point in optimizing by other models - it is a waste of time and computer resources. We can only check for lousiness of optimization results using all tick emulation models.

Reason: