Bar Time in seconds - page 2

 
Arpit T #:

 not sure why on a custom symbol its returning zero .

i think if the custom symbol does not have an origin it does not update that value , if i recall correctly.  

 
Conor Mcnamara #:
I think you should explain what your goal is. People could possibly give you a good creative solution if they understand your goal. If you wanted the live seconds since the last bar opened you could subtract iTime from TimeCurrent()

my goal is to break the while loop if bars stop updating. I am updating custom symbol bar data using while loop and there is no Tick present. while loop is running only in OnTimer() so we cant check lasttick and

SymbolInfoInteger(_Symbol,SYMBOL_TIME) on custom symbol does not work. 
 
Arpit T #:

my goal is to break the while loop if bars stop updating. I am updating custom symbol bar data using while loop and there is no Tick present. while loop is running only in OnTimer() so we cant check lasttick and

SymbolInfoInteger(_Symbol,SYMBOL_TIME) on custom symbol does not work. 

How are you implementing this ?

You have an EA that is talking to an API to get prices and then dumps them in the custom symbol ? 

If you want to trade that symbol on the API provider your tick event is when you read the tick .(edit : the latest tick)

Reason: