2

We are trying to let NetLogo take the real time data, but we didn’t found any threads helpful online that tells how.

We used historical stock price data to train our agents in the first stage. After the end of the training phase, we would like to use real time data to test the strategies generated by agents. In order to do this, we will need NetLogo to take the real time data online. Is there a way to let NetLogo to read stock prices online, eg. Yahoo Finance, and run automatically?

Could you please give us some hints on how to implement this in NetLogo? If NetLogo is incapable of doing this. Can anyone suggest other agent-based modeling tools that can do this?

Thankssssss.

4

1 に答える 1

2

NetLogo Web 拡張機能を使用して、任意の株価 API からリアルタイムの情報を取得できます。

Yahoo にはかなり単純な API があるようです。

たとえば、API を使用して Google の最新の株価を取得するには、次のようにします。

web:make-request "http://download.finance.yahoo.com/d/quotes.csv" "GET" [["s" "GOOG"] ["f" "l1"] ["e" ".csv"]]

現在、これは私に与えます:

observer> show web:make-request "http://download.finance.yahoo.com/d/quotes.csv" "GET" [["s" "GOOG"] ["f" "l1"] ["e" ".csv"]]
observer: ["556.65" "HTTP/1.1 200 OK"]

その結果は、最初の要素が応答の実際の内容 (この場合、文字列としての価格) であり、2 番目の要素が要求が成功したかどうかであるリストです。200 は、それが機能したことを意味します。

于 2015-03-11T16:43:07.667 に答える