code: def _get_position_value_from_df(
      evaluate_date, position, close_data_df
  ):
      """Get position value by existed close data df
      close_data_df:
          pd.DataFrame
          multi-index
          close_data_df['$close'][stock_id][evaluate_date]: close price for (stock_id, evaluate_date)
      position:
          same in get_position_value()
      """
      value = 0
      for stock_id, report in position.items():
          if stock_id != "cash":
              value += (
                  report["amount"]
                  * close_data_df["$close"][stock_id][evaluate_date]
              )
              # value += report['amount'] * report['price']
      if "cash" in position:
          value += position["cash"]
      return value
  
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  import pandas
  from scipy.stats import spearmanr, pearsonr
  from ..data import D
  from collections import OrderedDict
label_desc: Use image node_id 1 for calling a global function with example usage: _get_position_value_from_df(evaluate_date, position, close_data_df) and returns: value