Introduction to mean reversion strategy Flashcards

1
Q

setting if true a new column to 1

A

df.loc[df.long_entry,’positions_long’]= 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

simple moving average

A

df[‘moving_average’] = df.prices.rolling(5).mean()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In Python, fillna function is available on dataframe to fill missing values. The syntax is:

A

df = df.fillna(method=’ffill’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where are variables sotored

A

context.security

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When to close

A

time _rules.market_close(minutes=1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Hold logic

A

schedule_function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

entry function

A

def enter_position ( context , data ):

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

price

A

price =data.history( context.security, [“close”] , 90 , “1 m”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Three important points

A

schedule strategy logic functions
stream and process data
place orders

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

last You require the last 120 minutes of the close price data of a security. Which of the following options will fetch data to meet your criterion?

A
  1. history(security, [‘close’], 120, ‘1m’)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

% orders of capital

A

order_percent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Cointegration

A

Cointegration, combining of two different asset classes to increase stationarity, but with a spread between them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define perfect hedge ratio

A

To established the Hedge ratio using linear regression.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly