[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 481

 
stater:

Good day people, please give me an answer, how to determine that the 15-minute candle opened, I used a mind-boggling string, but as it turned out, not always the candle opens by time... I think there is a simpler way to find out that the candle opened... but I do not understand it...

if ((TimeMinute(TimeCurrent())==0 && TimeSeconds(TimeCurrent())==0)|| (TimeMinute(TimeCurrent())==15 && TimeSeconds(TimeCurrent())==0) || (TimeMinute(TimeCurrent())==30 && TimeSeconds(TimeCurrent())==0) || (TimeMinute(TimeCurrent())==45 && TimeSeconds(TimeCurrent())==0)


bool CheckOpenM15()
{
   static int PrevTime=0;
   if (PrevTime==iTime(NULL, PERIOD_M15,0)) return(false);
   PrevTime=iTime(NULL, PERIOD_M15,0);
   return(true);
}
The function returns true when a new bar appears on M15
 
Vinin:

The function returns true when a new bar appears on M15
Thank you very much!
 
stater:
Thank you so much!

To be used only in the council
 
midorum:

exactly so, it is automatically organised as a timeseries

you describe visible indicator buffers in the beginning

withIndicatorBuffers() you can extend the number of automatically organized timeseries buffers used to 8 and link them to your arrays

Many thanks for the previous answers. Everything works and almost everything is clear... Now about that "almost".

1. In which line (see attached file for indicator) is there an indication that the Line calculated on the array data should be displayed in the Client Terminal window?

2. Why is the IndicatorBuffers function needed (or rather, in what situations should it be used), if the number of buffers can be declared as a string

#property indicator_buffers 4                                           //объявляем количество буферов

Thank you in advance for your answer.

Files:
aom3_1.mq4  12 kb
 
I downloaded an EA for work in "one click", Compiled - no errors, but except the "face" in the corner does not show anything. Help !!!!!!!!!!!!!
Files:
ptq.txt  20 kb
 

Folks, a word of advice!

There is a custom function that counts the Low price of the 5th bar of the background timeframe, how do I make it count the price of a specific timeframe?

 
Good evening!
if (strela1<strela2){ 
   OrderSelect(ticket, SELECT_BY_TICKET);Print( "strela1<strela2  " , GetLastError()   ,"  ticket ",ticket);
   OrderClose(  ticket , OrderLots( ) , OrderOpenPrice( ) , 3, CLR_NONE);  
   Print( "OrderClose  " , GetLastError()   );                  
   OrderSend(Symbol( ), OP_SELL, lot, Bid, 3, NormalizeDouble( Ask+ (stoplos*Point),Digits), 
  NormalizeDouble( Ask-( takeprofit*Point),Digits), NULL, magicnumber, 0, CLR_NONE) ; 

2012.10.31 20:14:02 AUDUSD,M15: OrderClose 129

ERR_INVALID_PRICE 129Incorrect price

 
Is OrderOpenPrice( ) somehow insufficient or wrong? I've already compared the order of variables in the OrderClose function and the OrderSelect function, and re-read it... I don't know what's going on!
 
Look at the documentation, you probably think you put any number on it and it closes - but it doesn't!
 
But what's in there? Because I've been looking at it for 15 minutes... Yeah, maybe there's something simple I can't see!