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

 

For Roger.

Not going to sell, I'm not going to sell I'm all right with money. I want to share ideas and understand the reason for my stupidity ))

 

Please advise how to call custom AO and AC indicators via iCustom. And how to write the following condition through iCustom. Thank you in advance.


if (iAO(NULL,0,i) > iAO(NULL,0,i+1) && iAC(NULL,0,i)> iAC(NULL,0,i+1))
{ }
else
if (iAO(NULL,0,i) < iAO(NULL,0,i+1) && iAC(NULL,0,i) < iAC(NULL,0,i+1))

 
Stepan241 >> :

Folks, good afternoon.

I came across a Trend Detector on one of the forums. The author claimed it shows the trend very well and can help me in creating an oscillator system. But he implemented it directly in his Expert Advisor. I tried to make an indicator based on it. I want to see if it calculates correctly.

I quote the author:

-----------------------------------------------

I didn't expect such a good result from this finding of mine. Accidentally blinded it - put it up. And even jumped up from the surprise!

This method has been also slightly discussed here - here https://www.mql5.com/ru/forum/105321/page11



 

Good afternoon, all.

Could you please tell me how to calculate the number of crossings of the price of a certain level? I want my order to open after 3 (4,5...), but not after the first crossing.

Thank you.

 
Please tell me how to write the following conditions. If the current price is lower than the average price of the day, then.... and second, if the price at 14.56 (for example) of the current day is higher than the current price, then... It would be very interesting to get an answer. I cannot solve the problem myself yet. Thanks in advance.
 
future >> :
Please tell me how to write the following conditions. If the current price is lower than the average price of the day, then.... and second, if the price at 14.56 (for example) of the current day is higher than the current price, then... It would be very interesting to get an answer. I cannot solve the problem myself yet. Thanks in advance.
extern string xxxxxxxxxxxxx="x=0 сегодня х=1 вчера итд";
extern int х=0;
int середина=(iHigh(0,PERIOD_D1, х)-iLow(0,PERIOD_D1, х))/2;
if(Bid> середина)...;
if(Ask< середина)...;


extern datetime some_time=D'14:56';
int середина_some_time=(iHigh(0,0,iBarShift(0,0, some_time))-iLow(0,0,iBarShift(0,0, some_time)))/2;
if(Bid> середина_some_time)...;
if(Ask< середина_some_time)...;
 
skifodessa >> :

Good afternoon, all.

Can you please tell me how to calculate how many times the price has crossed a certain level? I want to open order after 3 (4,5...), but not after the first level crossing.

Thank you.

I understand that the conditions will be limited in time! (the third crossing will come tomorrow ))))

I advise to add to the conditions the data of the senior fame. (if M5..M30 then H1..H4)

For example

if(ССI(M5)>0 && CCI(H1)>0 ) OpenB();
 
Stepan241 писал(а) >>

Folks, good afternoon.

On one of the forums, I came across a TREND INDICATOR...

https://www.mql5.com/ru/forum/105321/page11#53278

 
Necron >> :

Please advise how to call custom indicators AO and AC through iCustom. And how to specify the following condition through iCustom. Thanks in advance.


if (iAO(NULL,0,i) > iAO(NULL,0,i+1) && iAC(NULL,0,i)> iAC(NULL,0,i+1))
{ }
else
if (iAO(NULL,0,i) < iAO(NULL,0,i+1) && iAC(NULL,0,i) < iAC(NULL,0,i+1))

Why do you need to call them through iCast at all? Is it for unification? Well, write a separate indicator-wrapper for each of them and use iCustom to call them...

 
skifodessa >> :

Good afternoon, all.

Could you please tell me how to calculate how many times the price has crossed a certain level? I want my order to open after 3 (4,5...), but not after the first level crossing.

Thanks.

For example, here is a universal variant. By the way, it would be useful to have a function to detect crossings:

int Cross(double a[], double level, int pos)
{
   if( a[ pos]< level&& a[ pos+1]> level) return(-1);
   if( a[ pos]> level&& a[ pos+1]< level) return(1);
   return(0);
}

i.e. if the crossing is up, it's 1, if it's down -1, otherwise it's 0

Now count (bars_limit - max time spread)

int count=0;
for ( i=0; i< bars_limit; i++)
{
   if( Cross( a, level, i)==1) count++;// ну или -1 если пересечения вниз считаем
}

if( count>=3) //4,5,...
{
...
}