code: def get_position_value(evaluate_date, position):
      """sum of close*amount
  
      get value of position
  
      use close price
  
          positions:
          {
              Timestamp('2016-01-05 00:00:00'):
              {
                  'SH600022':
                  {
                      'amount':100.00,
                      'price':12.00
                  },
  
                  'cash':100000.0
              }
          }
  
      It means Hold 100.0 'SH600022' and 100000.0 RMB in '2016-01-05'
      """
      # load close price for position
      # position should also consider cash
      instruments = list(position.keys())
      instruments = list(set(instruments) - {"cash"})  # filter 'cash'
      fields = ["$close"]
      close_data_df = D.features(
          instruments,
          fields,
          start_time=evaluate_date,
          end_time=evaluate_date,
          freq="day",
          disk_cache=0,
      )
      value = _get_position_value_from_df(
          evaluate_date, position, close_data_df
      )
      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 2 for calling a global function with example usage: get_position_value(evaluate_date, position) and returns: value