简体   繁体   中英

How can I get the Time[0] in different timeframes?

How can I get the Time[0] in different timeframe? I am only using one chart, Thank you in advance for helping.

for example, my current open chart is in 1H timeframe, I want to get the candle open time in 1H timeframe, in 30M timeframe and 15min timeframe, without changing the timeframe of current open chart.

To get Time value for the bar of specified timeframe use iTime() function.

Example (both alerts have same results):

Alert("Time[0]: ", Time[0]);
Alert("iTime[0]: ", iTime(Symbol(), PERIOD_CURRENT, 0));

For specified timeframe use enum timeframes .

Check also iTime docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM