code: def get_annual_return_from_positions(positions, init_asset_value):
      """Annualized Returns
  
      p_r = (p_end / p_start)^{(250/n)} - 1
  
      p_r     annual return
      p_end   final value
      p_start init value
      n       days of backtest
  
      """
      date_range_list = sorted(list(positions.keys()))
      end_time = date_range_list[-1]
      p_end = get_position_value(end_time, positions[end_time])
      p_start = init_asset_value
      n_period = len(date_range_list)
      annual = pow((p_end / p_start), (250 / n_period)) - 1
  
      return annual
  
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 5 for calling a global function with example usage: get_annual_return_from_positions(positions, init_asset_value) and returns: annual