How can I get the Time[0] in different timeframes?
How can I get the Time[0] in different timeframes?
Loading saved threads...
Stephen Nidea · External communityPost link
External question — Stack Overflow Stack Exchange
Author: Stephen Nidea
Original post: https://stackoverflow.com/questions/66718683
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
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.
Quote
Report
tomgny · External communityPost link
External answer — Stack Overflow Stack Exchange
Author: tomgny
Original post: https://stackoverflow.com/a/66721568
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
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
.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Stack Overflow Stack Exchange Author: tomgny Source score (net votes, not local likes): 3 Original post: https://stackoverflow.com/a/66721568 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. 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 .
Checking account access…