---
# System prepended metadata

title: 用未含申贖的淨資產計算實際申購買回價金、交易費及其他以當日淨資產計算之費用

---

# 台幣單級別ETF用未含申贖的淨資產計算實際申購買回價金、交易費及其他以當日淨資產計算之費用

```python=
#用未含申贖回的淨資產(有含經保費)回推經保費
def Calculatefee(OldNetAsset,Twsefeerate,Indexfeerate,managefeerate, storagefeerate,yeardays):
    global Twsefee1 ,Indexfee1,managefee1,storagefee1
    Twsefee1 = round(OldNetAsset*Twsefeerate/yeardays,0)
    Indexfee1 = round(OldNetAsset*Indexfeerate/yeardays,0)
    managefee1 = round(OldNetAsset*managefeerate/yeardays,0)
    storagefee1 = round(OldNetAsset*storagefeerate/yeardays,0)
    print(Twsefee1 ,Indexfee1,managefee1,storagefee1)
```
```python=
#用未含申贖的淨資產(有含經保費)計算第一次的實際申購買回價金及交易費
def calrealsubdis1(OldNetAsset,preunit,subunit,subtradefeerate,disunit,distradefeerate):
    global NewAsset
    Nav = OldNetAsset /preunit
    baseprice = round(Nav * 500000,0)
    realsubprice = baseprice * (subunit/500000)
    realdisprice = baseprice * (disunit/500000)
    realsubtradefee =round(baseprice*subtradefeerate,0) * (subunit/500000)
    realdisteadefee = round(baseprice*distradefeerate,0) * (disunit/500000)
    NewAsset = OldNetAsset+realsubprice-realdisprice+realsubtradefee+realdisteadefee
    print(NewAsset,realsubprice,realdisprice,realsubtradefee,realdisteadefee,Nav,(preunit+subunit-disunit))
    return NewAsset,realsubprice,realdisprice,realsubtradefee,realdisteadefee
```
```python=
#計算費用(因為要用當日淨資產計算，但當日淨資產尚未出來，所以用逼近的方式計算)
def Accfee(NewAsset,OldNetAsset,Twsefee1,Indexfee1,managefee1, storagefee1,yeardays,Twsefeerate,Indexfeerate,managefeerate, storagefeerate):
        
        NewAsset2 =  NewAsset
        
        for i in range(1,5):
            Twsefee2 = NewAsset2*Twsefeerate/yeardays
            Indexfee2 = NewAsset2*Indexfeerate/yeardays
            managefee2 = NewAsset2*managefeerate/yeardays
            storagefee2 = NewAsset2*storagefeerate/yeardays
            NewAsset2 = NewAsset + Twsefee1 + Indexfee1+managefee1+storagefee1- Twsefee2-Indexfee2-managefee2-storagefee2
            
        NewAsset = NewAsset2
        Twsefee2 = round(Twsefee2,0)
        Indexfee2 = round(Indexfee2,0)
        managefee2 = round(managefee2,0)
        storagefee2 = round(storagefee2,0)
        print(Twsefee2 ,Indexfee2,managefee2,storagefee2,NewAsset2)    
        
```
```python=
#因實際申購買回價金交易費及費用都有用當日淨資產計算，故要合併一起算
def calrealsubdisandfee3(OldNetAsset,NewAsset,preunit,subunit,subtradefeerate,disunit,distradefeerate):
    
    for i in range(1,15):
        Nav = NewAsset /(preunit+subunit-disunit)
        baseprice = round(Nav * 500000,0)
        realsubprice = baseprice * (subunit/500000)
        realdisprice = baseprice * (disunit/500000)
        realsubtradefee =round(baseprice*subtradefeerate,0) * (subunit/500000)
        realdisteadefee = round(baseprice*distradefeerate,0) * (disunit/500000)
        NewAsset = OldNetAsset+realsubprice-realdisprice+realsubtradefee+realdisteadefee #含申贖淨資產
        print(NewAsset)
        Accfee(NewAsset,OldNetAsset,Twsefee1,Indexfee1,managefee1, storagefee1,yeardays,Twsefeerate,Indexfeerate,managefeerate, storagefeerate)
        
        print(NewAsset,realsubprice,realdisprice,realsubtradefee,realdisteadefee,Nav,(preunit+subunit-disunit))
```
## 以下為案例
```python=
OldNetAsset = 1999863606 #未含申贖的淨資產(有含經保費)
preunit = 200000000 # 前日在外發行單位數
subunit = 4000000 #當日申購單位數
subtradefeerate= 0.001 #申購交易費綠
disunit = 0 #當日贖回單位數
distradefeerate = 0.004 #贖回交易費
Twsefeerate = 0.01 #上市櫃費費率
Indexfeerate = 0.0004 #指數授權費費率
managefeerate = 0.0015 #經理費率
storagefeerate = 0.0035 #保管費率
yeardays = 365 #年天數
global NewAsset
```
```python=
#計算最開始的費用 
Calculatefee(OldNetAsset,Twsefeerate,Indexfeerate,managefeerate, storagefeerate,yeardays)
#計算第一次實際價金跟含申贖淨資產
calrealsubdis1(OldNetAsset,preunit,subunit,subtradefeerate,disunit,distradefeerate)
print(NewAsset)
calrealsubdisandfee3(OldNetAsset,NewAsset,preunit,subunit,subtradefeerate,disunit,distradefeerate)
```
<font size = 5 >**以下為最終結果:**</font>
當日淨資產:2039901678
實際申購價金:39998072.0 
實際交易費:40000.0 
上市櫃費:55888.0 
指數授權費:2236.0 
經理費:8383.0 
保管費:19561.0 
<font size = 5 >**驗證方式:**</font>
以最終淨資產回推實際申購價金或是費用，計算結果會等於最後結果
EX:實際申購價金 = Round(當日淨資產/在外發行單位數*500,000,0)*(申購單位數/500,000) <br>=Reound(2039901678/204000000*500000,0)*(4,000,000/500,000)<br>= 39998072

EX2:經理費 = round(當日淨資產*經理費費率/365,0)<br>=round(2039901678*0.0015/365)<br>=8383

