quantitative-finance

Non-consecutive intraday index

ⅰ亾dé卋堺 提交于 2019-12-25 09:56:49
问题 This question is related to : Python pandas, how to only plot a DataFrame that actually have the datapoint and leave the gap out I'd like to know the easiest way to produce non-consecutive DateTimeIndex at intra-day resolution, that only maintains samples between certain [stock exchange] times e.g. 08:00-16:30, and has only given weekdays e.g. Mon-Fri. A bonus would be to be allow provision of a calendar of valid dates. At the day range, it's easy to do with pandas.bdate_range() for Mon-Fri.

Read HTML with Beautifulsoup and find typical data

南笙酒味 提交于 2019-12-25 04:14:31
问题 I wrote similar question before, but I need something different what I got from previous question. I have a html data which is written below (part of the data where I need). I already got rcpNo value, but eleId is changed from 1 to 33, offset, length don't have any regular pattern. Three of the data is consist of numbers, sometime different digit. I need to read rcpNO , eleId , offset , length and dtd . (dtd is fixed as 'dart3.xsd' but I try this only one html so there is possibility

Getting TTR to work on R 2.13? [duplicate]

大城市里の小女人 提交于 2019-12-24 23:50:58
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Cannot install R-forge package using install.packages Has anyone gotten the latest version of TTR from R-forge working on R 2.13? I can't install it on either my mac or my PC, even if I try compiling from the source. /edit: here's the exact error I'm getting, when I try to install from the R command line. install.packages("TTR", repos="http://R-Forge.R-project.org") Warning message: In getDependencies(pkgs,

Sort Datetime data by day, but from 4PM to 4PM

南笙酒味 提交于 2019-12-24 07:39:46
问题 I have Tweets from various times a day about companies, and I want to group them all by day. I have already done this. However, I want to sort them not from 00:00 until 23:59, but instead from 16:00 until 15:59 (because of the NYSE open hours). Tweets (Negative, Neutral and Positive is for the sentiment): Company,Datetime_UTC,Negative,Neutral,Positive,Volume AXP,2013-06-01 16:00:00+00:00,0,2,0,2 AXP,2013-06-01 17:00:00+00:00,0,2,0,2 AXP,2013-06-02 05:00:00+00:00,0,1,0,1 AXP,2013-06-02 16:00

How to “tie” 3 RSI-indicators to one Bollinger Band, using IMAonArray()?

你离开我真会死。 提交于 2019-12-23 05:44:30
问题 There are 3 RSI indicators, each having its own period. I want to tie all 3 to one Bollinger Band. Tell me how to do this better? for(i=limit; i>=0; i--) { ma=iMAOnArray(RSI,0,bb_period,0,0,i); // midle stdev=iStdDevOnArray(RSI,0,bb_period,0,0,i); // dev BBUP[i]=ma+bb_dev*stdev; // up BBDOWN[i]=ma-bb_dev*stdev; // down Buff4[i]=0; Buff5[i]=0; } if(limit<Bars-1) limit++; for(i=limit; i>0; i--) { if(PrevSignal >= 0) { if( RSI[i] < BBDOWN[i] && RSI[i+1] < BBUP[i+1] && RSI2[i] < BBDOWN[i] && RSI2

Converting data frame into Time Series using R [duplicate]

允我心安 提交于 2019-12-20 04:08:13
问题 This question already has answers here : How to convert data frame into time series? (5 answers) Closed 9 months ago . I have a time series data of the format Time Ask Bid Trade Ask_Size Bid_Size Trade_Size 2016-11-01 09:00:12 NA 901 NA NA 100 NA 2016-11-01 09:00:21 NA NA 950 NA NA 5 2016-11-01 09:00:21 NA 950 NA NA 5 NA 2016-11-01 09:00:21 905 NA NA 10 NA NA 2016-11-01 09:00:24 NA 921 NA NA 500 NA 2016-11-01 09:00:28 NA 879 NA NA 2 NA The structure of the dataframe is str(df) 'data.frame':

Write a loop for my function in r

南笙酒味 提交于 2019-12-12 05:19:06
问题 I am currently trying to write my first loop for lagged regressions on 30 variables. Variables are labeled as rx1, rx2.... rx3, and the data frame is called my_num_data. I have created a loop that looks like this: z <- zoo(my_num_data) for (i in 1:30) {dyn$lm(my_num_data$rx[i] ~ lag(my_num_data$rx[i], 1) + lag(my_num_data$rx[i], 2)) } But I received an error message: Error in model.frame.default(formula = dyn(my_num_data$rx[i] ~ lag(my_num_data$rx[i], : invalid type (NULL) for variable 'my

How to take minimum value out of several ask quotes and maximum value out of several bid quotes in two columns from a single column?

你说的曾经没有我的故事 提交于 2019-12-12 03:42:23
问题 I have a data set containing bid and ask quotes for 3 days and a stock. Following is the portion of the dataset. I have also given a link to the sample data set to illustrate the pecularity of the matter. > dput(head(q,30)) structure(list(Date = structure(c(1471424400, 1471424400, 1471424400, 1471424401, 1471424401, 1471424406, 1471424407, 1471424415, 1471424417, 1471424514, 1471424527, 1471424567, 1471424576, 1471424606, 1471424607, 1471424621, 1471424621, 1471424621, 1471424641, 1471424642,

manipulating value of pandas dataframe cell based on value in previous row without iteration

a 夏天 提交于 2019-12-12 03:22:28
问题 I have a pandas dataframe with~3900 rows and 6 columns compiled from Google Finance . One of these columns defines a time in unix format, specifically defining a time during the trading day for a market. In this case the DJIA from 930A EST to 4P EST. However, only the cell for the beginning of each day (930A) has the complete unix time stamp (prefixed with an 'a') and the others are the minutes after the first time of the day. Here is an example of the raw data: Date Close High Low Open

MQL4 Can you get the trade volume from the One Click Panel?

北城余情 提交于 2019-12-11 14:47:08
问题 Does anyone know if and how you can get the trade volume from the One Click Trade panel on the current chart? I'm putting together some quick trade scripts and would be great to pull the current trade volume or lot size from the one click panel. Thanks in advance 回答1: IMHO no The recent 24 months of Metatrader 4 ( re-inventing ) product updates have brought a few teasing elements ( One-Click-Trading[TM] ( OCT ), or Depth-Of-Market ( DOM ), New-MQL4 ( nMQL4 ) ). The bad news, nevertheless, is