?
Hi Everyone,
?
Hope everyone¡¯s doing great and all is well. I was wondering for the longest on TagValue implementation, especially as pertains to historical data. Would anyone care to comment or briefly say few words. Doesn't have to be here, but can continue elsewhere. Somewhat willing to compensate for any help, provided, response is continuously posted/public here, for public use.
For the longest, on historical data, I have been calling the method historicalData and saving the callback response into an ArrayList of <Bar> type and processing it for the opening of position. [In past I¡¯ve also used serialization, but I think that too costly]. My strategy is a simple momentum of ''look back'' one hour and whichever way the slope/momentum points, [[[ boom ;) ]]], and I go with that. I hope everyone dispenses with extraneous and tangential comments and lectures, not a pro programmer, am advanced to level of HashMaps/streams, etc. But tagValue, baffles me. Anyways, is there any use to the tagValue thing? The only pseudo-marginally (in applicability) yet inspirational helpful examples of implements have been Dmitry¡¯s TWS API FAQ. Thank you Dmitry. See Question is of course in java. See URL below. The properties of the Tag and Value are String. If wishing to work with doubles and int, lots of conversions would be required. Regardless worth it or not, I still would like to know basic how-to.
?
?
?
Basic outline of implementation would be helpful¡ªto the point of what classes needed (and how many :) ) and etc..??
Are we supposed to construct the TagValue thingie and then send it via the ¡°public static void HistoricalData_MainOPERATIONS¡± in Main and then somehow pick it up or get the response from the Ewrapper_Implementation class using getter and setters?
?
?
Here¡¯s my present implement¡. **Without** TagValue.
ArrayList<Bar>
??? ArrayList<Bar> barsHistDataArrayList = new ArrayList<>(); //new when making request
??? //! [historicaldata]
??? @Override
??? public void historicalData(int reqId, com.ib.client.Bar bar) {
??????? System.out.println("HistoricalData. " + reqId + " - Date: " + bar.time() + ", Open: " + bar.open() + ", High: " + bar.high() + ", Low: " + bar.low() + ", Close: " + bar.close() + ", Volume: " + bar.volume() + ", Count: " + bar.count() + ", WAP: " + bar.wap());
??????? barsHistDataArrayList.add(bar);
??? }
??? //! [historicaldata]
??? public ArrayList<Bar> getBarsHistDataArrayList() {
??????? return barsHistDataArrayList;
??? }
??? public void setBarsHistDataArrayList(ArrayList<Bar> barsHistDataArrayList) {
??????? this.barsHistDataArrayList = barsHistDataArrayList;
??? }
?? ?
??? //! [historicaldataend]
??? @Override
??? public void historicalDataEnd(int reqId, String startDateStr, String endDateStr) {
??????? System.out.println("HistoricalDataEnd. " + reqId + " - Start Date: " + startDateStr + ", End Date: " + endDateStr);
?????? ?
??? }
??? //! [historicaldataend]
?
?
Anyways, here¡¯s a sample of my program on GitHub if anyone cares to look into and help. -no rush
?
?
Main class
?
?
ReqHistorical is being called from line 132. I am hoping for some type of TagValue implement/help from lines 189-198. Do we have to construct it then pass to argument, and pick up from Ibkr response via Ewrapper_Implementation class.
?
On above github sample, I've deliberately, of course, left out some aspects. --Holy grail of profitability almost there..-- But the raw strategy is here.
?
?
?
No rush please- Please give help. Thank you forum as always!
?
-Rv