class_docstr: Reward proposed by paper "An End-to-End Optimal Trade Execution Framework based on Proximal Policy Optimization".
  
  Parameters
  ----------
  max_step
      Maximum number of steps.
  start_time_index
      First time index that allowed to trade.
  end_time_index
      Last time index that allowed to trade.
code: def reward(self, simulator_state: SAOEState) -> float:
      if (
          simulator_state.cur_step == self.max_step - 1
          or simulator_state.position < 1e-6
      ):
          if simulator_state.history_exec["deal_amount"].sum() == 0.0:
              vwap_price = cast(
                  float,
                  np.average(
                      simulator_state.history_exec["market_price"]
                  ),
              )
          else:
              vwap_price = cast(
                  float,
                  np.average(
                      simulator_state.history_exec["market_price"],
                      weights=simulator_state.history_exec[
                          "deal_amount"
                      ],
                  ),
              )
          twap_price = (
              simulator_state.backtest_data.get_deal_price().mean()
          )
  
          if simulator_state.order.direction == OrderDir.SELL:
              ratio = (
                  vwap_price / twap_price if twap_price != 0 else 1.0
              )
          else:
              ratio = (
                  twap_price / vwap_price if vwap_price != 0 else 1.0
              )
          if ratio < 1.0:
              return -1.0
          elif ratio < 1.1:
              return 0.0
          else:
              return 1.0
      else:
          return 0.0
  
file_path: qlib/qlib/rl/order_execution/reward.py
imports: from __future__ import annotations
  from typing import cast
  import numpy
  from qlib.backtest.decision import OrderDir
  from qlib.rl.order_execution.state import SAOEMetrics, SAOEState
  from qlib.rl.reward import Reward
label_desc: Use image node_id 2 for calling the PPOReward obj's underlying member method code with example usage: obj.reward(simulator_state) and returns: int, unknown, int, int