```
def isRun(year):
if year 0 ==0 and year @0 ==0:
return True
if year 0 ==0 and year @0 !=0:
return False
elif year % 4 ==0 :
return True
else:
return False
isRun(1996)
```
打卡作业
def initialize(context):
g.security = '300600.XSHE'
run_daily(period, time='every_bar')
def period(context):
date = context.current_dt.strftime("%Y-%m-%d")
if date == '2017-03-01':
order(g.security,100)
if date == '2017-03-31':
order(g.security,-100)
if date == '2017-03-01':
print('叼,老子买入了')
if date == '2017-03-31':
print('叼老子迈出了')
交作业
def initialize(context):
run_daily(period,time='every_bar')
g.security='600776.XSHG'
def period(context):
date=context.current_dt.strftime("%Y-%m-%d")
if date=='2018-03-01':
order(g.security,100)
if date=='2018-03-21':
order(g.security,-100)
if date=='2018-03-01':
print('拿下')
if date=='2018-03-21':
print('搞定')