I'm trying to come up with a real simple piece of code that just shows me the number of minutes / hours that I'm in an open position.
Basically what I know I should do is use
But this gives me a Time formatted value from year 1970. I'd rather just have a number of hours / minutes I can work with.
Anyone know if there is a function for this?
should give you the duration in seconds.
Then code to convert the seconds into hours and minutes
If you just need the value as a string for a Print, Comment or label
should do it
but I'm not sure what would happen if a trade is open more than 24 hours, so probably only good for short term trades
Please enable the necessary setting in your browser, otherwise you will not be able to log in.