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 iHook to monitor Elon Musk's insider trading activity for Tesla, by consuming the data provided by the website www.insidertrades.com.
1. Create an iHook scheduled task
After logging into iHook, click the CREATE TASK
button at the top left corner, then you will see the task creation form:
Under the Request Settings
and Request 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 |
Request 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 Notification
section, click the ADD
button next to the Email label:
Then a notification setup dialog will show up:
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 |
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 iHook 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.
Now click SAVE
, and you will see the new email notification appear under the Notification
section.
3. Save task
Click the CREATE
button at the bottom of the task creation page:
You'll see the created task in ACTIVE
state.
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 the TEST
button at the top of your task page. The TEST
button will trigger the HTTP request right away, and evaluate 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 iHook email notification whenever Elon Musk sells his Tesla shares.