Simulating on_candle events

It is often useful to trigger functions on the event a bar/candle is completed. The idea being that you have the correct OHLC data when you do whatever it is you want to do after this event.

It doesn't seem like any of the API functions will send a response on this event. The closest thing seems to be the subscribe option in the tick streams but this is only whenever the spot price changes at all, not when the latest candle is completed.

Of course, there are ways to manually simulate this by writing functions utilizing server time changes or noticing when the last two candles change in the stream etc but I think things would be more robust if there was a consistent/reliable way of doing this.

Does anybody have any input here?

P.S. If custom solutions for this are to be used with existing tools which API functions would be the best with regards to bandwidth etc?


Sign In or Register to comment.