I've found these small functions very useful when trying to pass datetime through Global Variables.
You can use it to save a value
when you want to get the value back.
Pivot Point (PP) indicator for use on timeframes < D1 with adjustable preceding day close time, elimination of sunday bars, optional display of weekly and monthly PP, preview of tomorrows' PP and current days' midpoints.ToolBox
Gives you information on pip value, spread value, daily pips average, how much you can earn, future range of the present day.