I have a google spreadsheet which helps us to track some stocks prices from the NASDAQ and DOWJONES. When I open the spreadsheet the prices automatically refresh via google finance built-in functions.
That is, for instance, the Apple price in a certain cell:
=GoogleFinance("AAPL";"price")
So far so good. Now we have a target buying price for each value and when the price falls below our target price we get an alert. I have written a script so that when this happens it sends me an email notification. Moreover, I have also configured a time-driven trigger which executes the script every 5 minutes.
But WHAT I really need is the WHOLE spreadsheet to open every 5 minutes not just only the script so that the Google finance funcions load and get the updated stock prices.
Is there a way to do that?
Not sure if this is the best approaching for a stock tracking spreadsheet so any ideas will be highly appreciated.
A standalone script will open a spreadsheet but it does not wait for the functions like GoogleFinance to complete so you may need to put in an explicit wait or loop until complete
Related
I am trying to create an alert on my saved search that will email when any of our sales channels do not have an order created within 2 hours.
This is the results criteria for the saved search
The lead source are the sales channels, and maximum of date created is the last time there was an order created. If it goes past 2 hours I want to be notified via email.
This is not possible to create purely within the UI.
You could create a scheduled script which will load the search, parse the results for any that are older than your threshold, and send the email from the search. This would run periodically depending on your deployment settings. Scheduled scripts can be deployed to run every 15 minutes, so the latest order may be up to ~2:15 old before the alert is sent.
Another approach may be to use a workflow which initiates on record creation and then has a 2 hour delay. Following the delay it could run a search for any newer orders, then if any are found it could simply exit, or if no newer orders are found it could proceed to sending an email. The actual implementation of running the saved search and acting based on the results will probably require a SuiteScript custom workflow action.
I have a cool flutter app which is used to track staff attendance. A user can check-in and check out when they start/stop working and the app record that event, calculate the number of hours worked and send a weekly summary to the manager of the staff expected wages. The current problem is that some staff members forget to check out (everyone is ok with check-in) so we don’t have good numbers and we need to manually change the attendance. I would like to add something to remember them to check out, and I am looking for creative ideas to do so. My objective is to make something very affordable.
So far I thought about two options:
to use geolocation and track when staff get in/out of a certain location and log it as check-in and check out
to set a timer when they start the shift and send a local notification if after xx hours they have not done the checkout
Geolocation seems to be the best because I can even automate the checkin/check out and do it in the backend but it will consme lots of resources in the client because I would need to check their location every while even when their at at home or on holiday...
The timer has some limits and still, I would need to manage background tasks that are complex as well as imprecise checkout depengin on when the notification goes out.
Do you have any suggestions on anything simple to implement?
I would suggest the second option.
A simple scheduler which would look for all the employees who are checked in for more than x number of hours and then throw a clickable notification to checkout. It would be an easy and clean solution. However, it has several limitations as an employee might leave early but checkout later.
In my opinion, Your most clean solution would be to have an RFID/NFC check which automatically registers as a user checks out from the building.
Another thing that can be done if your employees are working mostly on their computers. There can be a browser extension or a web app which will clock in the time they are working on their laptops. Once they close it they will be automatically checked out.
I am building a simple booking system on google calendar. However, users feel complicated, so I made a google form as a front end to simplify the data entry.
The process is straight forward. It's just form, sheets and then apps script. There is no functional problem.
There is performance issue.
The total time from Form submit to calendar update shown on browser takes in average 30 seconds. The time stamp on execution script shown less than one second to complete the apps script but it take more than ten second to start apps script. It means there is more than ten seconds for google form and sheets to complete and more than ten seconds for calendar to sync.
Any advice to shorten total processing time?
Thanks in advance,
Regards,
Thomason
Setting up some emails in Marketo (only to a client list where people opted-in).
I have about 2700 contacts after filtering them, but I don't want to send out 2700 emails at once. I want to send out about 100 per day.
The reason is that the sales team will quickly get overwhelmed if we send out 2700 emails, even if we only get a low percentage of responses.
Ideally, Marketo would have an option to "quit after X emails".
I know there's a random sample option, which I can set to 4%, but I'm using a smart list (actually a smart list where the contacts aren't in another smart list), and the random sample only works in a regular list to build it.
It's not really an option to create 20 lists and run one each day, even using random sample of 5%. Even if it was an option, this email is intended to run for at least several months as it slowly picks up new contacts.
Has anyone found a workaround for this need? We can't be the only ones who have this problem.
just use 'random sample' combined with 'run once' in the Schedule tab. Then set a recurring schedule so the Smart Campaign runs daily. Every day it will send the email to 4% of your Smart List, but excluding the people who already received the email. You can only set it to a percentage, not to an absolute number, so the absolute number of emails that goes out every day will vary on the smart list size. Periodically, you probably want to adjust the percentage so you can optimize the total number of emails that go out daily.
I'm trying to download 1 minute historical stock prices from Yahoo Finance, both for the current day and the previous ones.
Yahoo (just like Google) supports up to 15 days worth of data, using the following API query:
http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=1d/csv
The thing is that data keeps on changing even when the markets are closed! Try refreshing every minute or so and some minute bars change, even from the beginning of the session.
Another interesting thing is that all of these queries return slightly different data for the same bars:
http://chartapi.finance.yahoo.com/instrument/2.0/AAPL/chartdata;type=quote;range=1d/csv
Replace the bold number with 100000 and it will still work but return slightly different data.
Does anyone understand this?
Is there a modern YQL query that can fetch historical minute data instead of this API?
Thanks!
Historical minute data is not as easily accessible as we all would like. I have found that the most affordable way to gather Intraday Stock Price data is to develop automated scripts that log price information for whenever the markets are open.
Similar to the Yahoo data URL that you shared, Bloomberg maintains 1-Day Intraday Price information in JSON format like this : https://www.bloomberg.com/markets/api/bulk-time-series/price/AAPL%3AUS?timeFrame=1_DAY
The URL convention appears easy to input on your own once you have a list of Ticker Symbols and an understanding of the consistent syntax.
To arrive at that URL initially though, without having any idea for guessing / reverse-engineering it, I simply went here https://www.bloomberg.com/quote/AAPL:US and used Developer Tools on my browser and tracked a background GET request which led me to that URL. I wouldn't be surprised if you could employ similar methods on other Price Data-related websites.
You can also write scripts to track price data as fast as your internet goes. One python package that I find pretty handy and is ystockquote
You can have it request price data every couple of seconds and log that into a daily time series database.
Yes there is other APIs.
I don't know if it can still help but if you need intraday data, there is a API on rapidapi called (Quotient) which allows to pull intraday (at 1-min level), EOD market (FX, Crypto, Stocks (US, CANADIAN, UK, AUSTRALIA, EUROPE), ETFs and Futures. It also provides earnings, dividends, splits and a lot others informations.