Skip to content

Commit

Permalink
fix commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jookie committed Aug 31, 2024
1 parent 26d4d95 commit 548aa8b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 44 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<br>
<img src="public/groqlabs-logo-black2.png" alt="AI StockBot" width="500">
<br>
<br>
StockBot Powered by JojoFam: Lightning Fast AI Chatbot that Responds With Live Interactive Stock Charts, Financials, News, Screeners, and More
Jojo has three layers: market environments, agents, and applications. For a trading task (on the top), an agent (in the middle) interacts with a market environment (at the bottom), making sequential decisions.
<br>
</h2>

Expand All @@ -19,8 +18,8 @@
## JojoFin
JojoFin is library designed to facilitate financial trading strategies using deep reinforcement learning (DRL). It is tailored specifically for quantitative finance, providing tools and frameworks for traderss to create, test, and implement trading dtrategis using DRL techniques.
<br>
[Demo of StockBot](https://github.com/user-attachments/assets/a50fa266-5ae9-4869-a37f-599d7db790d9)
> Demo of StockBot providing relevant, live, and interactive stock charts and interfaces
[Experiments of StockBot](READMExperiment.md)
> Experiment of StockBot providing relevant, live, and interactive stock charts and interfaces
## Overview

Expand Down
40 changes: 40 additions & 0 deletions README_RUN_PY → READMEaetupColab
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@


<!-- ![alt text](https://i.ibb.co/4KJx9y0/Screen-Shot-2023-01-13-at-10-04-39-AM.png) -->
## Dependencies

- [Python 3 ](https://www.python.org/downloads/)
- [Alpaca SDK](https://alpaca.markets/)
- [Vercel](https://vercel.com)
- [Firebase Template](https://github.com/llSourcell/firebase_react_startup_template) *optional*

## Setup Instructions

1. Download the iPython notebook in this repository and upload it to [Colab](colab.research.google.com) to try it out.
2. Setup a simple [flask](https://flask.palletsprojects.com/en/1.1.x/quickstart/) app.
3. To set up a cron job for a Flask app deployed on Vercel that executes a Google Colab notebook at a given link every hour, you can use the built-in Vercel cron feature. Here are the steps to follow:
4. In your Flask app, import the necessary modules to run the Colab notebook, such as gdown or pyngrok
5. Create a new endpoint in your Flask app that triggers the execution of the Colab notebook, using the link to the notebook file.
6. Go to the Vercel project settings for your app and navigate to the "Cron" tab.
7. Create a new cron job that runs every hour by adding the endpoint you created in step 2 to the "Cron Job" field and select the frequency you want to run the job.

Here is a sample code snippet for step 2:

```python

from flask import Flask, jsonify
import gdown
app = Flask(__name__)

@app.route('/run-colab')
def run_colab():
gdown.download('https://drive.google.com/file/d/<colab_notebook_id>', 'colab.ipynb', quiet=False)
return jsonify(message='colab notebook ran successfully')

```

## Credits & More Resources

Credits for the notebook go to the Jojo Foundation, and for the API go to Alpaca.



## 🗒️ Answer

Here’s how you can implement a serverless function in a Next.js React TypeScript component to run a Python script when a button is pressed. The response from the server will be displayed in a text element.
Expand Down
40 changes: 0 additions & 40 deletions READMExperiment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,3 @@ I gave this trading bot $2000 because I was willing to lose $2000 to make a grea
5. If the expectd returns are above a certain threshold, buy, else hold. If they're below a certain threshold, sell. (using Alpaca API)

In order to have this Colab run automatically once a day, we can deploy it to a hosting platform like Vercel with a seperate file that repeatedly executes it.

![alt text](https://i.ibb.co/4KJx9y0/Screen-Shot-2023-01-13-at-10-04-39-AM.png)


## Dependencies

- [Python 3.7](https://www.python.org/downloads/)
- [Alpaca SDK](https://alpaca.markets/)
- [FinRL](https://github.com/AI4Finance-Foundation/FinRL)
- [Vercel](https://vercel.com)
- [Firebase Template](https://github.com/llSourcell/firebase_react_startup_template) *optional*

## Setup Instructions

1. Download the iPython notebook in this repository and upload it to [Colab](colab.research.google.com) to try it out.
2. Setup a simple [flask](https://flask.palletsprojects.com/en/1.1.x/quickstart/) app.
3. To set up a cron job for a Flask app deployed on Vercel that executes a Google Colab notebook at a given link every hour, you can use the built-in Vercel cron feature. Here are the steps to follow:
4. In your Flask app, import the necessary modules to run the Colab notebook, such as gdown or pyngrok
5. Create a new endpoint in your Flask app that triggers the execution of the Colab notebook, using the link to the notebook file.
6. Go to the Vercel project settings for your app and navigate to the "Cron" tab.
7. Create a new cron job that runs every hour by adding the endpoint you created in step 2 to the "Cron Job" field and select the frequency you want to run the job.

Here is a sample code snippet for step 2:

```python

from flask import Flask, jsonify
import gdown
app = Flask(__name__)

@app.route('/run-colab')
def run_colab():
gdown.download('https://drive.google.com/file/d/<colab_notebook_id>', 'colab.ipynb', quiet=False)
return jsonify(message='colab notebook ran successfully')

```

## Credits & More Resources

Credits for the notebook go to the Jojo Foundation, and for the API go to Alpaca.

0 comments on commit 548aa8b

Please sign in to comment.