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

 

Hello all. I need a momentum histogram. I was wondering if anyone could give me a histogram.

Thank you.

 
fozi:

Hello all. I need a momentum histogram. I was wondering if anyone could give me a histogram.

Thank you.

https://www.mql5.com/ru/forum/111497/page1075
Line or histogram, doesn't change the point, except visually.
 
That's what I'm saying, visuals are needed
 
fozi:
That's what I'm saying, visuals are needed
Files:
 

Is this function which detects an excessive movement correct?

extern int CandleVolume=60 - if the size of the previous candle is more than 60 pips

------ function checking the volume of the previous candle

int CheckVolume()
{

int volume=MathAbs(NormalizeDouble(Low[1],Digits)-NormalizeDouble(High[1],Digits));

if (volume <= CandleVolume) return (1);

if (volume > CandleVolume) return (-1);

}

-------- check as follows

if(CalculateCurrentOrders(Symbol())==0 && CheckVolume()==1)

{CheckForOpen();}

 

Another question: I am trying to check the previous bar. Buy check - Ask is higher than the High of the previous bar + spread. Sell check - Bid is lower than the Low of the previous bar minus the spread. How correct is this function? Unfortunately, it doesn't work.

int CheckBar()
{
double Spread=MarketInfo(Symbol(),MODE_SPREAD);
double PriceBuy=Ask;
double PriceSell=Bid;
if(PriceSell<(Low[1]-Spread)) return(-1);
if(PriceBuy>(High[1]+Spread)) return(1);
}
 
dzhini:

Another question: I am trying to check the previous bar. Buy check - Ask is higher than the High of the previous bar + spread. Sell check - Bid is lower than the Low of the previous bar minus the spread. How correct is this function? Unfortunately, it does not work.


int CheckBar(){   
   double Spread=MarketInfo(Symbol(),MODE_SPREAD);   
   double PriceBuy=Ask;   
   double PriceSell=Bid;   
   if(PriceSell   < (Low[1]  - Spread*Point)) return(-1);   
   if(PriceBuy  > (High[1] + Spread*Point)) return(1);
   return(0);
}
 
dzhini:

Another question: I am trying to check the previous bar. Buy check - Ask is higher than the High of the previous bar + spread. Sell check - Bid is lower than the Low of the previous bar minus the spread. How correct is this function? Unfortunately, it does not work.

I would not use the spread at all, as it often floats...
 
Vinin:

Thank you very much. It's working. Goes to my knowledge base )))) Please advise what to do with the function that defines the size of the previous candle?

extern int CandleVolume=60 - if the size of the previous candle is more than 60 pips

------ function that checks the volume of the previous candle

int CheckVolume()
{

int volume=MathAbs(NormalizeDouble(Low[1],Digits)-NormalizeDouble(High[1],Digits));

if (volume <= CandleVolume) return (1);

if (volume > CandleVolume) return (-1);

}

-------- check as follows

if(CalculateCurrentOrders(Symbol())==0 && CheckVolume()==1)

{CheckForOpen();}

 
AlexSTAL:
I would not use spreads at all, because they often float...


This is not a problem. With every tick we request a new spread, and the problem is solved - we will always have a fresh spread on every tick. If you work in a brokerage company with floating spreads, it would not hurt to ask for a mini-level with every tick.

SPR=MarketInfo(Symbol(),MODE_SPREAD);
MinLevel=MarketInfo(Symbol(),MODE_STOPLEVEL);