I could use a little help with this. For some reason it seems to function when I test it, but it doesn't when I run it live. I mean it runs but never makes any trades, even when all conditions are met.
Here's what it's supposed to do described:
It's supposed to run once a day, near market close.
It pulls insider trades for the day from the URL in the code, which has realtime insider trades in CSV format. (This data auto updates).
It will then place trades based on the data received via the URL if the following conditions are met...
- stock price must be between $1 and $5 (assigns 5 points)
- 'insider name' field must contain one of the following - "President", "CFO", "Director", "CEO", "COO", "VP", "Chief", "Executive" (assigns 5 points)
- Total value of the insider trade must be greater than $5000 (assigns 5 points)
- Stocks 90 day performance must be greater then the SPY 90 day performance ( assigns 1 point)
- Stocks current price must be overall better than its 365 day avg. (assigns 1 point)
For each of the conditions listed above the algorithm assigns the listed points above to calculate whether or not to go ahead and purchase. If total points is greater than 14 it's supposed to make a buy order for the stock.
This algo cant be effectively backtested because the data URL is realtime. However when I backtest it it seems to work and knows when to make the buy. But when I deploy it live, it's never made a buy, even when conditions are met.
Anybody got any ideas on how to get this running?