郭有才的爆火,真相实现蛮恐怖的

郭有才的爆火,真相实现蛮恐怖的。

平台的流量加持,造就一个个平民神话。

董宇辉,至少是一个文化符号,读了那么多的书,有那么深的思考。让很多人望尘莫及,也激发了很多人思考和读书的热情。

但郭有才,一首歌,一天拿到普通人一辈子收入。

这个叫榜样的力量?!

十年寒窗,谁还苦读。

有人说,这就是市场经济嘛。

你看科学家做冷板凳,十年如一日,还不如明星上两天综艺。

但不管怎么样,再流量明星,他至少长得好看吧,唱跳俱佳吧。至少有过一些作品,付出过努力吧。

而且,这样的人在人群中毕竟少数,大家不觉得可以有样学样。

全民娱乐至死。

但普通人,给出这个的先例,就不好了。

图片

图片

class SelectBySignal(bt.Algo):
    def __init__(self, df, rules_buy=[], buy_at_least_count=1, rules_sell=[], sell_at_least_count=1):
        super(SelectBySignal, self).__init__()
        self.rules_buy = rules_buy
        self.rules_sell = rules_sell
        self.df = df

        if buy_at_least_count > len(rules_buy):
            buy_at_least_count = len(rules_buy)
        if buy_at_least_count <= 0:
            buy_at_least_count = 1
        self.buy_at_least_count = buy_at_least_count

        if sell_at_least_count > len(rules_sell):
            sell_at_least_count = len(rules_sell)
        if sell_at_least_count <= 0:
            sell_at_least_count = 1
        self.sell_at_least_count = sell_at_least_count

    def _check_if_matched(self, df_bar, rules, at_least_count):

        se_count = pd.Series(index=df_bar.index, data=0)
        for r in rules:
            se_count += df_bar.eval(r)

        matched_items = se_count[(se_count.values >= at_least_count)].index
        return list(matched_items)

    def __call__(self, target):
        if len(self.rules_buy) == 0 and len(self.rules_sell) == 0:
            return True

        df_bar = self.df.loc[target.now]
        if type(df_bar) is pd.Series:
            df_bar = df_bar.to_frame().T
        df_bar.set_index('symbol', inplace=True)
        for c in df_bar.columns:
            df_bar[c] = df_bar[c].astype(float)
        # df_bar['roc_20'] = df_bar['roc_20'].astype(float)
        matched_buy = []
        matched_sell = []
        if self.rules_buy and len(self.rules_buy):
            matched_buy = self._check_if_matched(df_bar, self.rules_buy, self.buy_at_least_count)
        else:
            matched_buy = list(df_bar.index)  # 没有配置买入规则,但有卖出,就是选全选。

        if self.rules_sell and len(self.rules_sell):
            matched_sell = self._check_if_matched(df_bar, self.rules_sell, self.sell_at_least_count)

        #holdings = context.portfolio.positions.keys()
        if target.now in target.positions.index:
            sig = target.positions.loc[target.now] > 0
            holdings = list(sig[sig == True].index)  # noqa: E712
        else:
            holdings = []

        # holdings = target.get_long_symbols(target.ctxs)
        if holdings and len(holdings) > 0:
            matched_buy += holdings
            matched_buy = list(set(matched_buy))

        if matched_sell:
            for sell in matched_sell:
                if sell in matched_buy:
                    matched_buy.remove(sell)

        matched_buy = list(set(matched_buy))
        target.temp['selected'] = matched_buy
        # if len(matched_buy) > 1:
        #    print(matched_buy)
        return True

少即是多,Quantlab4.0重构中。

吾日三省吾身

财富自由为什么?为了把时间“浪费”在自己认为美好的事物上。

——那你直接把时间发在自己喜欢的事情上,不就好了?!

一个人,时间精力非常有限,一天能做的事情,非常少。

但长期复利的结果确很惊人。

这个矛盾的背后,是三天打雨两天晒网的人,很难拿到结果。

可是,努力与选择背后,只差一个坚持嘛?

没这么简单。

因为不确定,不确定付出多大可能可以得到回报,是结果注定就不好,还是努力不够?

因此,过程中要尽快建立反馈机制,确保你的努力可以“看得见”。

自己真的感兴趣,没有回报也愿意持续去做的事情。——天生热爱。

自己想用的产品,解决自己的问题,而不是盲目去抄一个竞品,光有样子没有灵魂。

时间,精力着实有限,“如无实在必要,勿加实体”,切实克制冲动。

开源世界很精彩,若非必要,不要重新造轮子。借助开源生态,快速达成自己的目标。

直奔目标而去,最重要的事情解决了,其它就变得不重要或者根本不需要做。

发布者:股市刺客,转载请注明出处:https://www.95sca.cn/archives/103385
站内所有文章皆来自网络转载或读者投稿,请勿用于商业用途。如有侵权、不妥之处,请联系站长并出示版权证明以便删除。敬请谅解!

(0)
股市刺客的头像股市刺客
上一篇 2024 年 7 月 29 日
下一篇 2024 年 7 月 29 日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注