Questions tagged [stocks]
313 questions
1
vote
1 answer
How can I use Math::Business::EMA with DBI to calculate exponential moving averages in Perl?
Script pulls data from mysql:
$DBI::result = $db->prepare(qq{
SELECT close
FROM $table
WHERE day <= '$DATE'
ORDER BY day DESC
LIMIT $EMA
});
$DBI::result->execute();
while($row = $DBI::result->fetchrow) {
print…

Dustin
- 11
- 1
1
vote
1 answer
AmiBroker AFL code - Shorts not firing
I am replicating some code that I wrote in C# in AmiBroker (I'm new to AFL). This code triggers the Longs, but never fires a short. The price data has plenty of shorts (proved by C# code). What am I missing? Shorts are essentially the reverse of…

Dave Tapson
- 810
- 1
- 9
- 22
1
vote
3 answers
SQL - Oracle - how to select securities from table with top change %
I need some help to complete a query in SQL-Oracle. I trying to have it select the row(s) or security/ies with the highest or max gain from price1 to price2. here is what i have already. When I try to use sub queries in the select or where clauses,…

DaviRoli
- 59
- 1
- 2
- 7
1
vote
1 answer
How to reuse results with a schema for end of day stock-data
I am creating a database schema to be used for technical analysis like top-volume gainers, top-price gainers etc.I have checked answers to questions here, like the design question. Having taken the hint from boe100 's answer there I have a schema…

Vishalrix
- 51
- 3
1
vote
2 answers
Web Service for finding basic company info
I'm looking for a web service similar to StrikeIron Zacks Company Profile. In particular I'm looking for company headquarters based on company name or stock ticker. If anyone knows where Google, Yahoo, or StrikeIron find this information, I would…

MilkJug
- 203
- 3
- 10
1
vote
2 answers
yahoo finance stock quotes - can't get get or put data
I am able to get stock prices from yahoo finance API with the following code. I can get US stocks, EFT, and even international quotes, but unable to get PUTS or CALLS. Any idea what technique I need to get these values?
try:
TD.TO, GDX, C,…
TD.TO, GDX, C,…

Mustapha George
- 2,497
- 9
- 47
- 79
1
vote
3 answers
Is there a way I can import price from google finance into google spreadsheet with 4 decimal places?
I have the formula to retrieve the data from google finance.
=googlefinance(D4; "price")
I am tracking some penny stocks and some of the prices have a price in 4 decimal places. When I import the price and it only imports the information with only…

OliverTwist
- 43
- 2
- 8
1
vote
1 answer
YQL query randomly fails
I'm using YQL to request data for a particular stock for displaying on my page (see my answer to a related YQL question).
Periodically, for no apparent reason, the call to get the stock data fails. If I simply refresh the page, then it'll (probably)…

daGUY
- 27,055
- 29
- 75
- 119
1
vote
2 answers
R DF referencing 2 different rows in same column (Returns)
I am trying to create a new column in my DF called "Returns" but I'm having difficulty finding how to divide 2 variables in the same column but different rows.
Here's the DF:
Date Open High Low AdjClose
2014-02-13 2014-02-13 1815…

Blackmarkt
- 71
- 1
- 7
1
vote
1 answer
Pulling Data Loop using R
Hello I am trying to write a loop that will help me retrieve data from a site using a loop, but I am stuck on how to paste the date onto the URL. For example, I am trying to retrieve the last 5 days of data....
# Get Todays Date
Friday <-…

Jason
- 311
- 1
- 4
- 14
1
vote
1 answer
Counting the frequency of an event
I have a string of stock price data data and I want to be able to count how many days the price moves up or down lasted. So for example, from the data I have a used "if" functions to determine if a day was up or down: "U" for and Up day and "D" for…

Omar
- 11
- 1
1
vote
1 answer
How does R handle entering and leaving positions with quantmod?
library(quantmod)
library(PerformanceAnalytics)
s <- get(getSymbols('SPY'))["2012::"]
s$sma20 <- SMA(Cl(s) , 20)
s$position <- ifelse(Cl(s) > s$sma20 , 1 , -1)
myReturn <- lag(s$position) * dailyReturn(s)
…

Chris
- 57
- 1
- 7
1
vote
2 answers
Is it possible to get the index of a exchange using Finance::Quote?
I need to get the index of a exchange like NASDAQ rather than the price of a specific stock in that exchange. I suppose that Finance::Quote will come to the rescue , but after a quick go-through of the document, I find it the way one can use the…

Haiyuan Zhang
- 40,802
- 41
- 107
- 134
1
vote
1 answer
How can I get rid of Nans in Matlab analyzing stock prices?
I have a file with a huge amount of data. Places where there is no information about prices are marked as NaN. I would like to delete all rows, where there are such names and delete all columns where there are a lot of missing data (because I need…

Claude Monet
- 143
- 1
- 1
- 8
1
vote
2 answers
google finance tools on my website?
i am on the process of building a website execlusively for trading purposes. including live quotes and level 2 quotes. charts. user protofollio with automatic updates. news and so on.
am i allowed to use google finance tools on my website? and if…

bilal
- 11
- 2