Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 917

 

Hello, here's a question on a foursome written on a fivesome. Who knows how to tell me...

Write and read ticks by an indicator.

https://www.mql5.com/ru/forum/6343/page400#comment_1768141

Started on previous page - can't beat iMAOnArray.

 
Pokrov:
Hi all, is it better to use one cycle for all purposes or several cycles in blocks? Is it a question of the EA performance or is there no difference?

And inside the loop you can have blocks, e.g. block of pending order analysis, block of market analysis, block of b/w movement.

for(int i=OrdersTotal()-1; i>=0; i--)
   {
      if(!OrderSelect(i,SELECT_BY_POS)) 
      {
         Print("OrderSelect( ",i," ) - Error #",GetLastError());
         continue;
      }
      if(OrderSymbol() != SymbolsArray[symNo])          continue;
      if(OrderMagicNumber() != Expert_ID) continue;
      if(OrderType()>3){  } //StopOrder
      if(OrderType()<2){  } //MarketOrder
   }
 
Rattnik:

Hello all.

To test the strategy on H1 I need to get the previous day's close.

In the indicator I write the following (after declaring "CloseLine" in OnInit()) :


int OnCalculate(const int rates_total, const int prev_calculated,

const datetime &time[], const double &open[],

const double &high[], const double &low[],

const double &close[], const long &tick_volume[],

const long &volume[], const int &spread[])

{

Close_Day=iClose("EURUSD",PERIOD_D1,1);

ObjectSet("CloseLine",OBJPROP_PRICE1,Close_Day);

return(rates_total);

}

As a result, the price from Day TF is not changed and the line is not rearranged.

Please help.

Thank you

Are you sure it makes sense to find out yesterday's clause on every tick? Maybe it's better to find out if the value has changed, and only if it has, then call ObjectSet and handle if it has failed?
 
Good evening if anyone has an indicator that calculates the number of ticks in a candle is that in the numbers above or below the candles. can not find such an indicator anywhere
 
roma1984:
Good evening, do you have an indicator that calculates the number of ticks in a candlestick, especially in numbers above or below the candlestick?
The indicator does not show the number of ticks in a candle. It only has no digits, you can view it by pressing ctrl+D and hovering over the candlestick.
 
danik:
In MT4 there are volumes. they are not from the exchange, they are tick volumes, i.e. they show the number of ticks in a candle. however, there are no numbers, you can see the numbers by pressing ctrl+D and hovering over the candle.
Thanks for the tip but it's a bit inconvenient
 
tatianati:

Hello, help please.

Looking for equality, low of the first bar with a maximum price for 20 bars starting from the 5th bar.

I put the arrow on the first bar.

Trying like this:

Doesn't put it right.

How about this?

if(MathAbs(iHigh(NULL,0,iHighest(NULL,0,MODE_HIGH,K_Bars,i+5))-lowr) < n*Point) //примерно равно)))

The variables need to be initialised as well.

 
tatianati:

you need exactly E, it's a range-approximately

I'm wondering if for the indicator I'm looking from the 5th bar to the 20th

Searching is correct, but the range is not. It's better to compare the modulus of the difference to a certain set number.

That's about right:

if(MathAbs(iHigh(NULL,0,iHighest(NULL,0,MODE_HIGH,K_Bars,i+5))-lowr) < n*Point) // разница меньше п пунктов
 
And if the zero bar is nowhere involved, it makes sense to start the loop at 1, then there will be no need to write [i+1].
 
evillive:

Search is correct, but range is not. It's better to compare the modulus of the difference to a certain set number.

There you go:

Got it, thanks for your prompt help.