Insider trading monitor
Insider trading activity can provide important insights into a company's performance and prospects. If you want to stay on top of insider trading activity for a particular company, you can set up a monitoring task and receive notifications whenever there is new insider trading activity for that company.
In this tutorial, we'll show you how to use CronDog to monitor Elon Musk's insider trading activity for Tesla, by consuming the data provided by the website www.insidertrades.com.
1. Create a CronDog scheduled task
After logging into CronDog, click New task on the All Tasks page. The task creation form opens with Request, Schedule, and Notifications sections.
Under the Request and Schedule sections, provide the following values:
| Field | Value | Notes |
|---|---|---|
| Task Name | Elon Musk Insider Trading Monitor - Tesla | The name of the task |
| URL | https://www.insidertrades.com/tesla-inc-stock/elon-musk | The URL to fetch Elon Musk insider trading information from www.insidertrades.com. |
| Request Method | GET | |
| Request Headers | None | No headers are needed |
| Schedule | Every 1 day | The task will run once every day |
This tells the task to fetch insider trading information for Tesla from www.insidertrades.com once every day.
2. Create email notification
The HTTP response body contains a table of insider trading activity in HTML format. Now let us set up an email notification, so we get notified whenever there is new insider trading activity appears in the table.
Under the Notifications section, click Add next to the Email label.
The Add email notification dialog opens.
Then provide the following values in the dialog:
| Field | Value | Notes |
|---|---|---|
| 1st condition | Response Body (HTML) - tbody > tr > td:nth-child(3) - is any value | Extract share number from insider trading table's first row, third column, always evaluates to true. The extracted value is referenced as ${condition.evaluatedSourceValue[0]} in email template |
| 2nd condition | Response Body (HTML) - tbody > tr > td:nth-child(4) - is any value | Extract sell price from insider trading table's first row, fourth column, always evaluates to true. The extracted value is referenced as ${condition.evaluatedSourceValue[1]} in email template |
| 3rd condition | Response Body (HTML) - tbody > tr > td:nth-child(1) - has changed | Extract sell date from insider trading table's first row, first column, evaluates to true when first row's sell date changed. The extracted value is referenced as ${condition.evaluatedSourceValue[2]} in email template |
| To | Your email address | |
| Subject | Elon Musk sold Tesla again! | The email subject |
| Message | New sell: ${condition.evaluatedSourceValue[0]} shares sold at ${condition.evaluatedSourceValue[1]} on ${condition.evaluatedSourceValue[2]} | The email body |
This tells CronDog to send an email notification whenever the insider activity table's first row's sell date column changes (3rd condition). The first 2 conditions are configured not as filters, but to populate the messaging context. This way we can show the number of shares sold and sold price in the email message.
Click Save. The new email notification appears under the Notifications section.
3. Save task
Click Create at the bottom of the task creation page.
After the task is created, CronDog opens the task detail page with the status set to Active.
4. Test task
To make sure your task settings such as URL and notification rules are properly configured, it's recommended to test your task at least once.
You can perform the test by clicking Run now at the top of the task page. Run now triggers the HTTP request right away and evaluates all configured notification conditions.
If everything went smoothly, you would receive an email notification the first time the task runs successfully since the evaluated condition value has changed from non-existent to some value.
Congratulations! You can now sit back and wait for the CronDog email notification whenever Elon Musk sells his Tesla shares.
