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

 
evillive:

Remember the time of the current bar and watch when the twentieth bar opens.

In other words, we should not rely on the serial numbers of bars, but calculate the serial numbers of bars on the basis of their opening times.

If the five-minute bar opened at 00-00, then the twentieth bar after it will open at 1-40

But we face a problem: if bar 1-00 is not on the chart, bar 20 will actually be bar 19.

And I need it to be exact.

 
solnce600:

In other words, we should not rely on serial numbers of bars, but calculate serial numbers of bars on the basis of their opening times.

If the five-minute bar opened at 00-00, then the twentieth bar after it will open at 1-40

But we face a problem: if bar 1-00 is not on the chart, bar 20 will actually be bar 19.

And I need it to be exact.



The +20 bar does not exist yet, it's in the future. So I will have to do something else.


And that the 1:00 bar is not on the chart during market hours and that the market opened at 00:00 - how is that? Have there been any precedents?

 
evillive:

I don't have the +20 bar yet, it's in the future. So I'll have to do something else.

Thank you very much for the valuable information.

I would be very grateful if you could advise me on my cranking options.

I only use 1-00 bar as an example and I have seen that some bars may be absent, especially on 5 min.

Thank you.

 
Well, if you don't like the bar counter, you can set an order time of +/- 1 minute. The zero bar time is the starting point. In general, there are two coordinates in the trading terminal - time and price.
 
evillive:
Well, if you don't like the bar counter, you can set an order time of +/- 1 minute. The zero bar time is the starting point. In general, there are two coordinates in the trading terminal - time and price.
Thank you. I will think over your advice.
 
Who knows? How to program the spread that we put in the tester, as I check with different values? I get it on Real or Demo, from MarketInfo()! And in the Strategy Tester, how?
  if(IsOptimization() || IsTesting() || IsVisualMode())
  {
    Spread = Х; //Какое выражение можно сделать, чтобы каждый раз не менять тут значение спреда?
    bid = NormalizeDouble(iClose(Symbol(),0,0),Digits);
    spr = NormalizeDouble(Spread*Point,Digits);
    ask = NormalizeDouble(iClose(Symbol(),0,0)+spr,Digits);
  }
  else
  {
    Spread = MarketInfo(Symbol(),MODE_SPREAD);
    spr = NormalizeDouble(Spread*Point,Digits);
    bid = MarketInfo(Symbol(),MODE_BID);
    ask = MarketInfo(Symbol(),MODE_ASK);
  }

Thank you, Owner! Why did you put the text in the SRC?! You're stretching my text so you can't catch "reply"! That's why I'm replying here. I got stuck that MarketInfo() doesn't work in the tester, that's why I got stuck. Of course, if I set spread in tester, I can get it from Aska-Bid difference, which I'll correct in my own code now! Tried it, it doesn't work! We only know the Bid, but how do we know the spread and Ask? Like the chicken and egg case before?

 
borilunad: Кто знает? Как запрограммировать спред, который проставляем в тестере, т.к. проверяю с различными значениями? На Реале или Демо понятно, от MarketInfo()! А в тестере как? Спасибо!
 if(IsOptimization() || IsTesting() || IsVisualMode())
  { RefreshRates();
    Spread = ((Ask-Bid)/Point);  //int  
    Spread = NormalizeDouble((Ask-Bid),Digits); //double
  }
  else
  {
    Spread = ((Ask-Bid)/Point);  //int  
    Spread = NormalizeDouble((Ask-Bid),Digits); //double
  }              
  1. Можно еще кончено в FXT файл залезть
  2. или symbols.raw отредактировать spread-символ в этом файле :)
 
solnce600:

I need to open an order 20 bars from the current value of the Bars variable

How do I code this?

Thank you.
By time, by bar offset, by moon, by solar system planets, but not by If 10 == 15, then open.
 
solnce600:

Thank you very much for the valuable information.

I would be very grateful if you could advise me on my unscrewing options.

Screwdriver, spanner, corkscrew, knife, fork...

What are we unscrewing?

 
artmedia70:
By time, by bar offset, by moon, by planets in the solar system, but not by If 10 == 15, then open.


You're shitting me.