Trady icon indicating copy to clipboard operation
Trady copied to clipboard

is it possible to process indicator using live data

Open softdev021 opened this issue 7 years ago • 12 comments

library looks great but i have one question lets say i am subscribed to some feed and every second i am getting new Candle is it possible to calculate indicator value on that candle. instead of reprocessing all candles again?

softdev021 avatar Sep 01 '18 16:09 softdev021

I achieved this by using the StartIndex, EndIndex parameter to indicator Compute function

andyb1979 avatar Sep 01 '18 16:09 andyb1979

Great can you please give some example i am just getting started will be great help.... Thankyou

softdev021 avatar Sep 01 '18 19:09 softdev021

It’s open source software bro, you have to work it out :D

andyb1979 avatar Sep 01 '18 19:09 andyb1979

okay thanks :) just allow me to ask one more question please for example if i am using following code var closes = new List{ ... }; suppose closes list lenth is 31 var smaTs = closes.Sma(30); var sma = closes.Sma(30)[index];

so if i add another close in closes list i can get value by index bit it again processing all array right. so i wanted to know does the indicator cached the previously calculated value and process just the new value.

softdev021 avatar Sep 01 '18 19:09 softdev021

It’s. it my project so I don’t know, but I suggest try it out :D

andyb1979 avatar Sep 01 '18 19:09 andyb1979

@softdev021 the value is re-computed, there's no caching mechanism in indicator computation.

karlwancl avatar Sep 11 '18 03:09 karlwancl

Also related to #29

karlwancl avatar Sep 11 '18 03:09 karlwancl

I'm looking for the same as @softdev021. It would be nice if indicators, that base on previous values, had a parameter to pass "starting point", which would be a previous value of that indicator. Thanks for your great lib !

andrzej-suwala avatar Sep 11 '18 11:09 andrzej-suwala

@andrzej-suwala it sounds good but the effort to complete this feature is not trivial, I might have to spend some time to work on it, it would be a great help if you guys could create a PR for the feature 😄

karlwancl avatar Sep 12 '18 10:09 karlwancl

@andrzej-suwala it sounds good but the effort to complete this feature is not trivial, I might have to spend some time to work on it, it would be a great help if you guys could create a PR for the feature 😄

thanks IppKarl actually problem is suppose we are running some bot for very long period now obviously candle count will increase. hence processing time of indicator also increases due to which one can miss the entry point when placing trade via bot automatically. if you can achieve this it will be great...

softdev021 avatar Sep 19 '18 12:09 softdev021

This is an interesting and highly desired feature. The current design is a very functional approach. This would require holding state. And the two designs conflict.

I would definitely like to see this come to play, but we would need to come up with a solid stateful design so that calculations are performed on the new elements and not on the old.

I would like to see a proposal come forward.

irperez avatar Feb 05 '19 15:02 irperez

I wrote a bot using binance API + this lib, watching ~125+ assets real time, analysing with major indicators realtime, no need to do that as @lppkarl mentioned. It's only using 30 threads and ~250mb of ram. Just cache the candlestick data on file system or on some doc db to prevent refetch. It's fast enough. Just be sure to use async programming..

alikalfaoglu avatar Nov 12 '19 20:11 alikalfaoglu