# Tag Info

3

My understanding, in that context, is that signal indicates that you want to hold a share (signal is 1) or hold no shares (signal is zero). Therefore taking the diff will tell you if you want to buy (signal zero to 1, diff is 1), sell (signal 1 to zero, diff is -1) or do nothing (signal stays at zero or stays at 1, diff is zero).

2

Note: Assuming you're a bit of a beginner trying to learn the ropes of how this whole process works at a high level, I can definitely make a couple recommendations (if I'm interpreting that wrong then I apologize if the explanation below isn't what you're after). If you're trying to learn some basic backtesting fundamentals, while QuantStart is an amazing ...

2

def bbands(price, length=30, numsd=2): """ returns average, upper band, and lower band""" ave = pd.stats.moments.rolling_mean(price,length) sd = pd.stats.moments.rolling_std(price,length) upband = ave + (sd*numsd) dnband = ave - (sd*numsd) return np.round(ave,3), np.round(upband,3), np.round(dnband,3) sp['ave'], sp['upper'], ...

2

The TA_lib Technical Analysis library here has open source code for numerous indicators.

2

First of all, I do not believe the "optimal smoothing" of an estimator (like the mean or the variance) and the "regression case" are the same. The smoothing of an existing estimator (like mean or variance in the blog post), is an univariate problem, where the regression is a multivariate one. In the regression case, you should be able to change the ...

2

Did you try solving for $w_k$? $$\bar{r}_t = \sum_{k=0}^p w_k r_{t-k}$$ $$\bar R = W R$$ Since you probably have $t>>k$, you can solve for $W$ using OLS $$\bar R = W R +\varepsilon$$ -- UPDATE You can try applying Kalman filter. Here, your state evolution is $$r_t=\mu+\varepsilon_t$$. You introduce new vector $x_t=(r_t, r_{t-1}, \dots, ... 1 Under weak-form efficient markets neither situation is more profitable to buy in. Contrarily, under technical analysis, the answer depends on whether you adhere to a mean-reverting or a momentum theory of the market. Under the former, your supposition is correct. Under the latter, certain shorter-term MAs crossing certain longer-term MAs from below are ... 1 They are different things, it depends on what you are looking for: Bollinger bands are constructed based on the standard deviation of closing prices over the last n periods. An analyst can draw high and low bands a chosen number of standard deviations (typically two) above and below the n-period moving average. The bands move away from one another when ... 1 got my answer myself, and the answer is: That depends, but people mostly use close price. http://www.macroption.com/calculating-moving-average-prices/ 1 Thanks @Aksakal for suggesting Kalman Filter. Here I provide more details. We will view it as a state-space model: $$\begin{split} z_t &= A_t z_{t-1} + B_t u_t + \epsilon_t, \\ y_t &= C_t z_t + D_t u_t + \delta_t, \\ \epsilon_t &\sim \mathcal{N}(0, Q_t),\ \delta_t \sim \mathcal{N}(0, R_t), \end{split}$$ where$z_t\$ is the latent variable, ...

1

The Technical Analysis of Financial markets is considered as a milestone of the matter. I suggest to read that before starting to test your strategy. It explains well the use of each indicator, providing the economic reason behind that and when it is useful to use that; moreover, the book deals the stock market with mainly, as you need for. In my humble ...

1

A very good reference can be found here: http://www.asiapacfinance.com/trading-strategies/technicalindicators

1

I think wiki calculated upon new way and your excel calculated upon Wilder way (Wilder book). I have same issue when use both method. Look like new Metastock 5 software offer both method.

Only top voted, non community-wiki answers of a minimum length are eligible