NO LINKS, SOURCE CODE REQUESTS OR MODIFICATION OF DECOMPILED INDICATORS. To avoid post deletion please follow the rules.

How can I find the Bars number corresponding to different time zone

#1
How can I find the Bars number corresponding to different time zone at the same time in a piece of code running on the 5 minute chart.
OPenTF15=iClose(Symbol(),15,i]; how can I find the value corresponding to the i value in the 5 minute chart in the code.
If i=25 in the 5-minute chart, using it as i=25 in m15 will return an incorrect result.

Code: Select all

void OnStart()
  {
//---
  int total=2543;
    for(int i=0;i<total;i++)
      {
       double OpenTF5=Open[i];

       double OPenTF15=iClose(Symbol(),15,i]; // how do find this Bars numbers on TFm15
        
      }
   
  }


Re: How can I find the Bars number corresponding to different time zone

#2
mbastem wrote:
Sat Sep 18, 2021 4:29 am
How can I find the Bars number corresponding to different time zone at the same time in a piece of code running on the 5 minute chart.
OPenTF15=iClose(Symbol(),15,i]; how can I find the value corresponding to the i value in the 5 minute chart in the code.
If i=25 in the 5-minute chart, using it as i=25 in m15 will return an incorrect result.

Code: Select all

void OnStart()
  {
//---
  int total=2543;
    for(int i=0;i<total;i++)
      {
       double OpenTF5=Open[i];

       double OPenTF15=iClose(Symbol(),15,i]; // how do find this Bars numbers on TFm15
        
      }
   
  }
if you know a valid range of values use [start and end values in an if statement ] to limit your operations https://book.mql4.com/operators/if
also [print function ] might be useful
https://www.mql5.com/en/docs/common/print

regards


  1. Similar Topics

    1. What is this system?can i find it online for free?

      0 Replies 478 Views

      by Snipper, Sat Jun 19, 2021 5:56 am in Trading Systems

      0 Replies
      478 Views
    2. ACTION ZONE:ORIGINAL MATRIX

      112 Replies 5466 Views

      by amdudus, Sat Aug 14, 2021 7:52 pm in Trading Systems

      112 Replies
      5466 Views
    3. Same strategy on the different timeframes?

      8 Replies 940 Views

      by ionone, Sat Mar 20, 2021 8:36 pm in Forex Education

      8 Replies
      940 Views

Return to “MT4 Indicators”

Users viewing this forum: andrei-1, arobin, CommonCrawl [Bot], easetup13, Gari369, Gosfraba, Jimmy, JNascente, KAYJIRAH, kvak, meda, Msquared, Nanyuki, nbibu, rudiarius, samuelkanu, Seznam [Bot], talaate, Thangarasu, toddanderson, vitas334, Yandex [Bot], 太虚一毫 and 94 guests