Close trend after 2 hours
Created at 28 Mar 2018, 11:02
Close trend after 2 hours
28 Mar 2018, 11:02
Hello all
I want to measure time (in hours) trades are open. I want to close a trade is open longer than 2 hours.
Doing this var diff = Server.Time - pos.EntryTime works fine, however when I compare if(diff>2) i get the error "can't compare timespan with int".
Thanks
Patrick
PanagiotisCharalampous
28 Mar 2018, 11:06
Hi Patrick,
Try diff.Hour
Best Regards,
Panagiotis
@PanagiotisCharalampous