Index | Recent Threads | Who's Online | Search

Posts: 127    Pages: 13    Prev 1 2 3 4 5 6 7 8 9 10 Next
Last Post
New Thread
This topic has been viewed 3188 times and has 126 replies
InspectorSector
Re: Python code for calling 123 API

Marco - Thanks for asking. I understand this function is supported in Dataminer. But I am working on a bigger project using Python in Colaboratory. Ultimately, it may involve doing multiple ranking dumps on a weekly basis. So my preference is to automate it using Python instead of doing part of the job manually in Dataminer and having to screw around with running and saving files. It eliminates human errors and a lot of time.

Nov 18, 2020 10:21:28 AM       
marco
Re: Python code for calling 123 API

Interesting. Perhaps we should load our sample code in Colaboratory.Thanks

Portfolio123 Staff.

Nov 18, 2020 10:25:13 AM       
marco
Re: Python code for calling 123 API

Will you be using the machine learning features of colaboratory ?

Portfolio123 Staff.

Nov 18, 2020 10:32:11 AM       
InspectorSector
Re: Python code for calling 123 API

Yes - tensorflow and xgboost.

Nov 18, 2020 10:52:59 AM       
InspectorSector
Re: Python code for calling 123 API

So for anyone following this thread:

I had to change Valmarv's code
from:
print(client.ranks({'rankingSystem': 264499, 'asOfDt': '2015-04-21', 'universe': 'nasdaq100'}))

to
print(client.rank_ranks({'rankingSystem': 264499, 'asOfDt': '2015-04-21', 'universe': 'nasdaq100'}))

Then it worked. It returned UIDs, followed by Tickers, then ranking values.

Attachment colab.gif (388171 bytes) (Download count: 62)


Nov 18, 2020 11:09:51 AM       
InspectorSector
Re: Python code for calling 123 API

For anyone wanting to use Colab with the P123 API.

For this code to work, you have to place a copy of p123api.py on Google Drive. It has to be the original text file from GitHub. Don't try to save it to Google Drive using Colab. It won't work! You may need to adjust the path in sys.path.append('/content/gdrive/My Drive/Colab Notebooks') to match your Drive setup.

Nov 18, 2020 11:25:40 AM       
marco
Re: Python code for calling 123 API

Interesting work Steve. Perhaps this is the ticket for us to distinguish ourselves from the rest.

But how much ML stuff can you do w/o a data license? Right now all you can download is ranks and future performance data. Is that what you are using? Perhaps it is enough though and don't really need the data point itself

We need to setup examples for people to tinker around with ML

Portfolio123 Staff.

Nov 18, 2020 11:54:55 AM       
Edit 1 times, last edit by marco at Nov 18, 2020 11:55:38 AM
InspectorSector
Re: Python code for calling 123 API

Marco - how much historical rank data am I allowed to download?

Nov 18, 2020 12:00:30 PM       
portfolio123
Re: Python code for calling 123 API

no limits . only limits now is # api requests because we're still in beta and finalizing the product entitlements. But with a decent p123 membership should be plenty. Can you store the data in colaboratory?

Nov 18, 2020 12:07:07 PM       
Jrinne
Re: Python code for calling 123 API

Yes - tensorflow and xgboost.


All,

I think Steve will confirm that I have been working with him on this. I have been using TensorFlow and Boosting for a long time and they are incredible tools.

Colab is a free tool that I introduced to Steve. It saves the hassle of using terminal and brew (on Macs) to be able to use multiple processors and load XGBoost, download Anaconda, Python, libraries and modules and keeping these all compatible.

No one has asked P123 to make machine learning available on its platform for a long time. Colab makes that largely unnecessary.

BTW, Colab is free but can be sped up an upgraded for $9.99 a month. I doubt anyone would need this but I think Colab would be adequate for even the most demanding needs.

Recently I installed a library (with Anaconda) which required an update of TensorFlow to use. My program no longer ran. Turns out that only some of the TensorFlow and Keras interactions and coding had been changed. But I was lost for couple days. I thought I would have to start from scratch and download everything.

Okay too much of a long, sad story but Colab would have avoided all of that and I think Steve would even agree that Colab is a lot more user friendly (even with his programming skills). If Colab does not work just close the window and start again—importing the correct libraries this time.

Steve’s posts DO NOT even hint at his programing abilities. Steve is an incredible programmer.

It is nice that P123 is helping someone with this. But I will say that considering Steve’s programming skill this is a long thread.

If it took this long for Steve to get this to work, I can guarantee that P123 is missing an opportunity that the average programmer presents.

Maybe P123 will not lose me as Steve has been very kind to share is programming code with me while I share my experience with TensorFlow and XGBoost. But honestly, P123 could be better.

There are easier ways to do this and depending on whom you ask possibly better ways—with no PIT issues. P123 will have to do more to achieve its full potential, IMHO. If it were me, I would not stop here.

Did I mention Steve is an incredible programmer? With one of the better performing Designer Models? I can say with 100% confidence that anyone reading this would be a fool not to look for Deep learning or Boosting models that Steve may develop.

While Steve has already made this work, P123 could make this a little more user-friendly and attract more than elite programmers like Steve to P123 with this.

Best,

Jim

From time to time you will encounter Luddites, who are beyond redemption.
--de Prado, Marcos López on the topic of machine learning for financial applications

Nov 18, 2020 12:15:38 PM       
Edit 12 times, last edit by Jrinne at Nov 18, 2020 12:47:03 PM
Posts: 127    Pages: 13    Prev 1 2 3 4 5 6 7 8 9 10 Next
 Last Post