class_docstr: (S)elect the (B)etter one among every two adjacent trading (B)ars to sell or buy with (EMA) signal.
class_docstr_tok: ["(","S",")","elect","the","(","B",")","etter","one","among","every","two","adjacent","trading","(","B",")","ars","to","sell","or","buy","with","(","EMA",")","signal","."]
code: def _reset_signal(self):
      trade_len = self.trade_calendar.get_trade_len()
      fields = ["EMA($close, 10)-EMA($close, 20)"]
      signal_start_time, _ = self.trade_calendar.get_step_time(
          trade_step=0, shift=1
      )
      _, signal_end_time = self.trade_calendar.get_step_time(
          trade_step=trade_len - 1, shift=1
      )
      signal_df = D.features(
          self.instruments,
          fields,
          start_time=signal_start_time,
          end_time=signal_end_time,
          freq=self.freq,
      )
      signal_df.columns = ["signal"]
      self.signal = {}
  
      if not signal_df.empty:
          for stock_id, stock_val in signal_df.groupby(
              level="instrument"
          ):
              self.signal[stock_id] = stock_val["signal"].droplevel(
                  level="instrument"
              )
  
imports: from pathlib import Path
  import warnings
  import numpy
  import pandas
  from typing import IO, List, Tuple, Union
  from qlib.data.dataset.utils import convert_index_format
  from qlib.utils import lazy_sort_index
  from ...utils.resam import resam_ts_data, ts_data_last
  from ...data.data import D
  from ...strategy.base import BaseStrategy
  from ...backtest.decision import BaseTradeDecision, Order, TradeDecisionWO, TradeRange
  from ...backtest.exchange import Exchange, OrderHelper
  from ...backtest.utils import CommonInfrastructure, LevelInfrastructure
  from qlib.utils.file import get_io_object
  from qlib.backtest.utils import get_start_end_idx
label_desc: Use image node_id 2 for calling the SBBStrategyEMA obj's underlying member method code with example usage: obj._reset_signal() without return types