- 论坛徽章:
- 0
|
基金份额.收益计算
while
clear
do
echo "\033[5;6H"
echo " 基金份额.收益计算 "
echo " **************************************"
echo " 1. 认购"
echo " 2. 申购"
echo " 3. 赎回"
echo " 4. 收益计算(持有期间无分红)"
echo " 5. 操作说明"
echo " 0. 退出"
echo " 选择∶\c"
read p
case $p in
1) echo " 输入认购金额: \c"
read q
echo " 输入认购费率(1%输入0.01):\c"
read j
echo "$q $j">1
awk '{print " 认购份额为: " $1-$1*$2"份"}' 1
read a;;
2) echo " 输入申购金额: \c"
read q
echo " 输入当日净值: \c"
read j
if [ $j -eq 0 ]
then
echo " 输入错误,请重新输入 "
read a
else
echo " 输入申购费率(如:0.015): \c"
read m
echo "$q $j $m">1
awk '{print " 申购份额为: " $1/$2-$1/$2*$3"份"}' 1
read a
fi;;
3) echo " 输入赎回份额: \c"
read q
echo " 输入当日净值: \c"
read j
echo " 输入赎回费率: \c"
read m
echo "$q $j $m">1
awk '{print " 赎回金额为: " $1*$2-$1*$2*$3"元"}' 1
read a;;
4) echo " 输入申购金额: \c"
read q
echo " 输入申购当日净值: \c"
read j
if [ $j -eq 0 ]
then
echo " 输入错误,请重新输入"
read a
else
echo " 输入申购费率: \c"
read m
echo " 输入赎回当日净值: \c"
read J
echo " 输入赎回费率: \c"
read M
echo "$q $j $m $J $M">1
awk '{print " 收益金额为: " ($1/$2-$1/$2*$3)*$4-($1/$2-$1/$2*$3)*$4*$5-$1"元"}' 1
read a
fi;;
5) echo ""
echo " 1. 因在abis中所查询基金净值非当日净值,而是上一日净值或前一是净值,所以输入净值 时要注意.最好以基金网站公部的净值为准."
echo " 2. 输入净值时,如 0.5%应输入0.005"
echo " 3. 持有期间如遇分红,应先在abis中查出基金份额再用(3.赎回)计算."
echo " 4. 因四舍五入原因计算结果可能有差异."
read a;;
0) exit;;
esac
if [ -s 1 ]
then
rm 1
fi
done |
|