Day1

Alphas:mathematical models that seek to predict the future price movement of various financial instruments

backtesting:using code to test rules' potential performance

-returns:前一日相对更弱的股票偏多,前一日相对更强的股票偏空。


Day2

What does '-returns' mean?

--returns is a data field that has the stock's returns for each company on each date.


Day3

PnL Graph:profit and loss

1774712245483

Sharpe

the measure of risk adjusted returns earned by the alpha.

风险调整后收益

higher values of sharpe are better

Sharpe = Avg. Annualized Returns / Annualized Std. Dev. of Returns

Turnover

the percentage of the capital which the alpha trades each day

More turnover may mean higher transaction costs during trading.

Value Traded / Value Held

Fitness

function(returns,turnover,Sharpe)

Fitness=Sharpe * Sqrt(Abs(Returns)) / Max(Turnover,0.125)

Good alphas have high fitness.

increasing Sharpe (or returns) and reducing turnover

Returns

how much profit an Alpha can generate

Drawdown

Drawdown represents the percentage of the largest loss incurred during any year in your backtesting.

最大损失的百分比

As a practice, you should target a return-to-drawdown ratio greater than one. The higher the ratio of returns to drawdown, the better it may be for your alpha.

Margin


Day 4

rank()

rank() ranks the input values and arranges them evenly from 1 to 0 in descending order. For example, if there are 5 stocks, it returns 5 values like 0, 0.25, 0.5, 0.75, 1 according to the input value order.

After calculating rank() , it goes through a process called neutralization (中和).

Decay衰减

Decay allows easy control of the rate of position changes . However, note that applying Decay may weaken signal strength as current Alpha values reflect more slowly. Typically, values under 10 are used for Decay.

Day 5 :About Price Volume Alpha

PV Data

relates to price and volume

includes stock prices - open(开盘价),high,low,close-and other trading related information like volume of shares traded(成交量) and market capitalization(市值)

Volume(成交量)

indicates the number of shares investors transacted that day

计算不同天的平均值,使用ts_mean(volume,N)

VWAP(Volume-Weighted Average Price)成交量加权平均价

represent a day's stock price,resulting from dividing the sum of price times volume by the total volume sum

使用sum(price*volume)/sum(volume)

Alpha Ideas

Momentum(动量):assume that stocks which have performed weil in the past wil continue to perform well.

typically appears over longer periods(several months or more)

Reversion(反转) : if something increases today,it will fall tomorrow.This something can be anything:price,volume,correlation between two things or the other indicators/variables that you can think of while developing your alpha.

appears over shorter periods

The rank(-returns) is a simple example of implementing the reversion effect.

VWAP is the average price weighted by volume for the day, while closing price is the last traded price. By comparing VWAP and closing price, we can understand how the last traded price compares to the day's average. For example, if the closing price is much higher than VWAP, we can interpret that the price rose near market close. The opposite tend to be true as well.

Since reversion theory assumes prices return to their mean, we can implement an Alpha using the formula " vwap/close ". This takes long positions when closing prices fall below VWAP, and short positions when they rise above it.

如果收盘价远高于 VWAP,我们可以理解为价格在收盘前上涨。反之亦然。由于回归理论假设价格会回到其均值,我们可以使用公式 "vwap/close" 来实现一个 Alpha。当收盘价低于 VWAP 时,该策略建立多头头寸;当收盘价高于 VWAP 时,建立空头头寸。

觉得有用的话,点个赞