However, it is able to Print correct value, BUT I cannot pass it to OnBarUpdate, in which I run my calculations. [1- calculations don't work, 2- Print command run in OnBarUpdate returns 0]
I could add, that I want this to work not just in RealTime, but also in any mode, like Backtest, Simulation and all that. 95% of my work is done "behind the scenes", so I want to test it properly before going Live.
How can this be fixed?

Comment