@chaudhariapurva Thanks for your suggestion. can you please give an example. also how the input data should be changed to (i suppose which is sourced from historic api)
hi @trader007 It depends on your time horizon , if trading intraday with time horizon of 1 day u can save the ticks to calculate indicators othervise u will have to subcribe to the historical API and feed data to library to get the outputs. It really depends on your strategy. As for the technical asspect of feeding data to TALIB ,Its api is quite flexible so if want to change input mechanism simply write a wrapper for it
@chaudhariapurva .. if i'm storing ticks from web sockets, then i need to run a different code right? since once you connect to sockets your rest of the code runs ( which means strategy will not run)
also isnt there a chance that ticks received are incomplete or missing which means my strategy is comprimised. so dont you think its safe & convenient to use historical api?
@trader007 the granularity on historical ApI is of 1 min ,so if u want to use indicators like PVT(Price volume trend),or VWAP,or market profile visualization which really work well on tick data(or atleast one sec data) you will have to store the tics, and to store the tics just start a thread and use some synchronization mechanism to send data to and fro.For incomplete or erroneous tics you need to do sanity checks ,this is also true for historical api where the api gives you [""] data if you call a date where there was a holiday.Lol(maby they solved it now).
Hi @trader007 , Im not that good in python , but there will always be someone who has faced a problem like yours in such a popular language like python(use text file as db ,sql also works fine and gives you greater flexibility),my advice at this point will be to explore your options carefully ,if there is a library avaialble you will find it or try to develop your own and us stackexchange or others like it for reference. with python you can even use c++(super fast libraries),checkout-->http://www.swig.org/ the pseudicode should be like this Thread1() { lock(obj) { write tick as they arrive from websocket buffer toa suitable storage location } }
Thread2 OR MAIN () { lock(obj) { read the data } process and place trades }
Hi @trader007 , Im not that good in python , but there will always be someone who has faced a problem like yours in such a popular language like python(use text file as db ,sql also works fine and gives you greater flexibility),my advice at this point will be to explore your options carefully ,if there is a library avaialble you will find it or try to develop your own and us stackexchange or others like it for reference. with python you can even use c++(super fast libraries),checkout-->http://www.swig.org/ the pseudicode should be like this Thread1() { lock(obj) { write tick as they arrive from websocket buffer toa suitable storage location } }
Thread2 OR MAIN () { lock(obj) { read the data } process and place trades }
Are there fns builtin in kite library of python?
KiteConnect is purely an execution platform. It doesn't have any methods for indicators.
i cant get it through sockets right?
For minute's OHLC you need to use Historical API
download TA LIB API .
It works really well
http://ta-lib.org/function.html
http://ta-lib.org/hdr_doc.html
I am assuming you understand python and pandas and numpy library to do backtest
1 last question. can i use sockets to calculate those (i dont think so. just want to know of something is there)
since once you connect to sockets your rest of the code runs ( which means strategy will not run)
also isnt there a chance that ticks received are incomplete or missing which means my strategy is comprimised. so dont you think its safe & convenient to use historical api?
Also where do we need to store data.. I a sql database or variable?
Im not that good in python , but there will always be someone who has faced a problem like yours in such a popular language like python(use text file as db ,sql also works fine and gives you greater flexibility),my advice at this point will be to explore your options carefully ,if there is a library avaialble you will find it or try to develop your own and us stackexchange or others like it for reference.
with python you can even use c++(super fast libraries),checkout-->http://www.swig.org/
the pseudicode should be like this
Thread1()
{
lock(obj)
{
write tick as they arrive from websocket buffer toa suitable storage location
}
}
Thread2 OR MAIN ()
{
lock(obj)
{
read the data
}
process and place trades
}
Im not that good in python , but there will always be someone who has faced a problem like yours in such a popular language like python(use text file as db ,sql also works fine and gives you greater flexibility),my advice at this point will be to explore your options carefully ,if there is a library avaialble you will find it or try to develop your own and us stackexchange or others like it for reference.
with python you can even use c++(super fast libraries),checkout-->http://www.swig.org/
the pseudicode should be like this
Thread1()
{
lock(obj)
{
write tick as they arrive from websocket buffer toa suitable storage location
}
}
Thread2 OR MAIN ()
{
lock(obj)
{
read the data
}
process and place trades
}
This will be very helpful