edtechre / pybroker

Algorithmic Trading in Python with Machine Learning

Home Page:https://www.pybroker.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

设置了ctx.score的值后,买入的具体原则是怎样的,这个ctx.score具体作用和影响是什么呢

kachadx opened this issue · comments

def rotate(ctx: ExecContext):
if ctx.long_pos():
if ctx.symbol not in pyb.param('top_symbols'):
ctx.sell_all_shares()
else:
target_size = pyb.param('target_size')
ctx.buy_shares = ctx.calc_target_shares(target_size)
ctx.score = ctx.indicator('roc_20')[-1]
设置了ctx.score的值后,买入的具体原则是怎样的,这个ctx.score具体作用和影响是什么呢

Hi kachadx,

ctx.score is used to rank symbols, see this notebook:
https://www.pybroker.com/zh-cn/latest/notebooks/4.%20Ranking%20and%20Position%20Sizing.html