Forums > Java

Getting data in different outlets

January 16, 2013 | 9:34 am

Hello

I extended the Java stockwatch object to get more data. However, soetimes data is unavailable and because of that, the data in the cells are shifted. As such the data that I get in my message boxes is not correct. Hence I would like to know if it is possible to get the data out via different outlets in the Java object so I do not have to use the unpack object. In attachment is my patch and the Java class

– Pasted Max Patch, click to expand. –
Attachments:
  1. DataScapR.class

January 16, 2013 | 10:32 am

BTW: I found that in my subpatch I had a send object duplicated, hence the shift. However, I still would like to know how to unpack that data in different outlets with the Java object.


January 16, 2013 | 2:31 pm

You have to use outlet(1,…) to send to the second outlet (that you also need to create in your object constructor, see declareOutlets). I’m not sure this will help if the data are not received properly though.


January 17, 2013 | 12:44 pm

Thank you. Indeed, the data are not getting in correctly so I will leave them out. I am adding all outlets now and when I am ready I will post the patch here.

Now, asking for a strategy: I would like to have muliple instances of my patch. But as I am using a lot of send/receive objects the send and receivers should be named (for example: send data1 (for the first instance) send data2 (for the second instance) and so on. Probable this is something for Javascript but how should I implement that?


January 17, 2013 | 7:07 pm

Wait . . . whut?

Duplication of a Send object causes a shift or offset to occur? This might explain some odd behaviour I’m seeing in some of my own hackjobs.

Would anyone care to elucidate on this further please?


January 18, 2013 | 4:43 pm

I am messing this topic up: I will explain
1) Yahoo Finance API provides stock market data. However, some data come in with bugs (and yahoo does not support the stream). For example: the Ask Size of a stock (how many shares are being asked for) is 456 (four hundred fifthysix) and will be presented as a string "456". Now when the Ask Size is above 1000 we run into problems. Example: 1.654 (thousand six hundred and fifthyfour). Due to the bug in Yahoo’s API, the data will be displayed as two strings: "1" and "654". So when I have this Ask Size cell between other data that I am tracking, Max is going to think that the Ask Size is "1" and the "654" string will be seen as the following datapoint (in my case that is Volume, the number of stocks traded).

I thought it was something I had done wrong in the JAVAcode as I am not a programmer but other people experienced this problem as well. Hence, I took out the Ask Size as the incoming data were unusable.

2) I am only tracking one stock at the moment because i do not know how to get data from each stock separately. Using the first outlet only gives me the data from the last stock in the chain. Therfore I am looking for a way to run duplicates of the patch but each one tracking other stocks. However, I am sending the data I receive from Yahoo to my instruments. If I get a duplicate of the patch running and I do not change the send/receive object’s names I am sure I wil run into trouble. Hence I am working now on a solution where, when running multiple instances of the patch, the send7receive object have different names


Viewing 6 posts - 1 through 6 (of 6 total)