Skip to content

Commit d30210c

Browse files
authored
Update Algorithm.py
1 parent 9263a04 commit d30210c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Monthly Momentum Model/Algorithm.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# IMPORT LIBRARIES
2-
#=========================================================================================
2+
#------------------
33
import numpy as np
44
import pandas as pd
55

@@ -31,7 +31,7 @@
3131
"""
3232

3333
# INITIALIZE ALGORITHM
34-
#=========================================================================================
34+
#-----------------------
3535
def initialize(context):
3636

3737
# UNIVERSE DECLARATION
@@ -61,7 +61,7 @@ def initialize(context):
6161

6262

6363
# SETTINGS
64-
#=========================================================================================
64+
#----------
6565

6666
# SCHEDULE SETTINGS FOR THE 'REBALANCE' FUNCTION
6767
schedule_function(func=rebalance,
@@ -88,7 +88,7 @@ def initialize(context):
8888

8989

9090
# EVERYDAY BEFORE TRADING START:
91-
#=========================================================================================
91+
#--------------------------------
9292
def before_trading_start(context, data):
9393

9494
# CALL PIPELINE BEFORE TRADING START
@@ -104,7 +104,7 @@ def before_trading_start(context, data):
104104

105105

106106
# RECORD AND RETURN VARIABLES: RETURN THE TOP TEN RETURN RANKING STOCKS FROM THE LONG AND SHORT LISTS
107-
#======================================================================================
107+
#-----------------------------------------------------------------------------------------------------
108108
def record_vars(context, data):
109109

110110
# RECORDED METRICS DURING BACKTEST -- LEVERAGE
@@ -119,7 +119,7 @@ def record_vars(context, data):
119119

120120

121121
# REBALANCE
122-
#=========================================================================================
122+
#-----------
123123
def rebalance(context,data):
124124

125125
# DEFINE THE TARGET WEIGHT OF EACH STOCK IN THE PORTFOLIO TO BE EQUAL ACROSS BOTH LISTS

0 commit comments

Comments
 (0)