I tried to use the "time_s" function for that purpose:
Code: Select all
LastDurationSeconds= (time_s - time_s[1]);
So when the market is opened in the morning I need to re-start calculating the duration.
Otherwise the indicator (depending on my two very novice codes) plots some strange numbers:
It either plots a huge number (18:30 to 10:00 becomes the 1st bar's duration)
Or it posts some negative value... which is funny...
Can someone help me with this?