TimeFrame Minutes
TimeFrame Minutes
20 Aug 2020, 16:13
Is there a property / quick method to know how many minutes a TimeFrame has?
I right now I do it in the following way:
var minutes = (Bars [1] .OpenTime - Bars [0] .OpenTime) .TotalMinutes;
// this would be ideal
var m = TimeFrame.Minutes;
Replies
genappsforex
21 Aug 2020, 12:09
RE:
bienve.pf said:
Is there a property / quick method to know how many minutes a TimeFrame has?
I right now I do it in the following way:
var minutes = (Bars [1] .OpenTime - Bars [0] .OpenTime) .TotalMinutes;
// this would be ideal
var m = TimeFrame.Minutes;
this will work on 99.999% of the times, But if it is mission critical .....
On smaller timeframes (e.g. M1) there is not always a tick in every timeframe
=thus=> not a OnBar on every timeframe
=thus=> Bars [1] .OpenTime - Bars [0] .OpenTime could be 2 or more minutes apart!!!
Therefor a TimeFrame Native function like TotalSeconds() would be nice!
@genappsforex
PanagiotisCharalampous
21 Aug 2020, 08:22
Hi bienve.pf,
There is no other way at the moment. Your solution should work fine.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous