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

 
dzhini:
Good afternoon. Can you tell me if it is possible to see the opening prices of 1 minute candlesticks inside a 5 minute candlestick?
Of course, you have to look at the M1 chart to do this.
 
alsu:
Of course, you have to look at the M1 chart to do that.
I actually meant the software implementation of getting such information on M5, not a visual assessment of the chart. This is, after all, a forum not only about trading, but more about programming :)
 
dzhini:
I was actually referring to the software implementation of getting such information on M5, not the visual assessment of the chart. This is, after all, a forum not only for trading, but more for programming :)


You can look in different ways. Including programmatically

 
Vinin:


There are a number of ways to watch. Including programmatically.

How nice that you are interested in the question. I cannot figure out how to make an indicator which would peep into the history and memorize information about each of five one-minute candlesticks in one five-minute candlestick (for example). I can't think of the peeping function itself. I tried to do the following:

1. made a function that triggers the reader every minute

2. the reader runs the iOpen(Symbol(),1,1) function and saves it in a variable.

as it should be, this method failed... I tried to find some information about it on the web site and on the Internet, but unfortunately I failed. Can you give me some pointers, please?

 
dzhini:

How nice that you are interested in the question. I can't figure out how to make an indicator that peeks into the history and remembers information on each of the five one-minute candles within one five-minute candle (for example). I can't think of the peeping function itself. I tried to do the following:

1. made a function that triggers the reader every minute

2. the reader runs the iOpen(Symbol(),1,1) function and saves it in a variable.

as it should be, this method failed... I tried to find some information about it on the web site and on the Internet, but unfortunately I failed. Can you give me some pointers, please?

Why can't you just look at the M1?
 
Zhunko:
Why can't you just look at the M1?
Because you have to implement it programmatically so you don't have to look
 
dzhini:
because you have to implement it programmatically so you don't have to look

you can get the opening price of any minute bar, so what's the problem?

iOpen(Symbol(), PERIOD_M1, номер_нужного_бара)
 
dzhini:
because you have to implement it programmatically so you don't have to look at it
This is how M1 is made, among other things, so that it is not implemented programmatically.
 
alsu:

you can get the opening price of any minute bar, so what's the problem?

Since you have taken the initiative, let's try to come up with a code that would signal us every minute with the opening price of a minute candle on a five-minute chart (with the ability to work in a tester). I propose my own variant:

int start()
  {

   if(NewBar(1)) 
   {      
      double OPEN=iOpen(Symbol(),1,1); 
      Alert(OPEN);
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+

bool NewBar(int TimeFrame) 
  {
//----
   int shift = getShift(TimeFrame, 0);
   
   static datetime NewTime;               // ????? ???????? ????
   bool NewBar=false;                     // ?????? ???? ???
   if( NewTime!=iTime(NULL,TimeFrame,shift))
     {
      NewTime=iTime(NULL,TimeFrame,shift);                    // ?????? ????? ?????
      NewBar=true;                    // ???????? ????? ???
     }
//----
   return(NewBar);
  }
  
//--------------
int getShift(int timeframe, int shift)

{
  return(iBarShift(NULL, timeframe, Time[shift]));
}
 

I don't understand, are you checking up on us all?

If there is a problem, describe it.