# Monkeybeat calculations
## Case 1
### 1 month returns of INFY
┌─symbol──┬────return_percent─┐
│ INFY.NS │ 7.163674060807157 │
└─────────┴───────────────────┘
### Value of Rs 1O000 invested over 30 days in INFY
```csv
"close_date","present_close","initial_close","percent_diff","current_invested"
"2022-10-18",1487.4443359375,1487.4443359375,0,10000
"2022-10-19",1469.3916015625,1487.4443359375,-1.2136746188637573,9878.632538113625
"2022-10-20",1484.6746826171875,1487.4443359375,-0.1862021491087836,9981.379785089122
"2022-10-21",1484.2789306640625,1487.4443359375,-0.21280831806337291,9978.719168193662
"2022-10-24",1501.44140625,1487.4443359375,0.941014730724561,10094.101473072456
"2022-10-25",1509.800048828125,1487.4443359375,1.502961310920905,10150.296131092091
"2022-10-27",1523.949951171875,1487.4443359375,2.4542508484101626,10245.425084841016
"2022-10-28",1513.25,1487.4443359375,1.734899480876057,10173.489948087607
"2022-10-31",1537.6500244140625,1487.4443359375,3.375298642346779,10337.529864234677
"2022-11-01",1573,1487.4443359375,5.75185652299226,10575.185652299226
"2022-11-02",1553.300048828125,1487.4443359375,4.427440496394626,10442.744049639463
"2022-11-03",1530.75,1487.4443359375,2.9114140957218066,10291.141409572181
"2022-11-04",1514,1487.4443359375,1.7853215357980177,10178.532153579801
"2022-11-07",1507.449951171875,1487.4443359375,1.344965640127027,10134.496564012703
"2022-11-09",1511.199951171875,1487.4443359375,1.5970759147368303,10159.707591473683
"2022-11-10",1501.949951171875,1487.4443359375,0.9752039040326482,10097.520390403264
"2022-11-11",1570.0999755859375,1487.4443359375,5.556889602617745,10555.688960261774
"2022-11-14",1585.300048828125,1487.4443359375,6.578781506398283,10657.878150639828
"2022-11-15",1594,1487.4443359375,7.16367406080716,10716.367406080715
```
### Conclusion
Data matches exactly when only one stock is there in portfolio.
## Case 2:
### 1 month returns of INFY and HDFC
┌─symbol──┬────return_percent─┐
│ HDFC.NS │ 14.74707233322703 │
│ INFY.NS │ 7.163674060807157 │
└─────────┴───────────────────┘
Average Returns is 10.95%
```python
>>> x=14.74707233322703+7.163674060807157
>>> x
21.910746394034184
>>> x/2
10.955373197017092
>>>
```
### Value of Rs 1O000 invested over 30 days in INFY AND HDFC
```csv
"close_date","present_close","initial_close","percent_diff","current_invested"
"2022-10-18",3819.09423828125,3819.09423828125,0,10000
"2022-10-19",3851.191650390625,3819.09423828125,0.8404456687044245,10084.044566870443
"2022-10-20",3853.8746337890625,3819.09423828125,0.9106974936409297,10091.069749364093
"2022-10-21",3834.1788330078125,3819.09423828125,0.39497833217520156,10039.49783321752
"2022-10-24",3894.44140625,3819.09423828125,1.9729067487651033,10197.29067487651
"2022-10-25",3866.5,3819.09423828125,1.2412828477383828,10124.128284773838
"2022-10-27",3907.25,3819.09423828125,2.308289772876192,10230.82897728762
"2022-10-28",3913.699951171875,3819.09423828125,2.477176707040397,10247.71767070404
"2022-10-31",4007.4500732421875,3819.09423828125,4.931950436648701,10493.19504366487
"2022-11-01",4079.199951171875,3819.09423828125,6.8106649551461,10681.06649551461
"2022-11-02",4061.300048828125,3819.09423828125,6.341969991708757,10634.196999170876
"2022-11-03",4020.14990234375,3819.09423828125,5.264485543383275,10526.448554338327
"2022-11-04",4000.64990234375,3819.09423828125,4.753893272458433,10475.389327245843
"2022-11-07",4014.849853515625,3819.09423828125,5.1257079040414855,10512.570790404148
"2022-11-09",4014.699951171875,3819.09423828125,5.121782828240857,10512.178282824087
"2022-11-10",4006.050048828125,3819.09423828125,4.89529189075504,10489.529189075503
"2022-11-11",4221.7999267578125,3819.09423828125,10.544533948389729,11054.453394838973
"2022-11-14",4246.85009765625,3819.09423828125,11.200453109727604,11120.04531097276
"2022-11-15",4269.5,3819.09423828125,11.793523113518434,11179.352311351844
```
### Conclusion
Average Returns (10.95%) doesn't match the percentage difference 11.79% when there's more than one stock.
## Case 3
Quite a lot of difference here :disappointed:
### 1 month returns of INFY and PAYTM
```csv
"symbol","return_percent"
"INFY.NS",7.163674060807157
"PAYTM.NS",-5.426826408721697
```
### Value of Rs 1O000 invested over 30 days in INFY and PAYTM
```csv
"close_date","present_close","initial_close","percent_diff","current_invested"
"2022-10-18",2149.8943481445312,2149.8943481445312,0,10000
"2022-10-19",2121.8416137695312,2149.8943481445312,-1.3048424635010991,9869.51575364989
"2022-10-20",2117.4246826171875,2149.8943481445312,-1.5102912175831678,9848.970878241684
"2022-10-21",2113.87890625,2149.8943481445312,-1.6752191532395262,9832.478084676048
"2022-10-24",2138.94140625,2149.8943481445312,-0.5094641931583381,9949.053580684165
"2022-10-25",2166.1500244140625,2149.8943481445312,0.7561151218226482,10075.611512182264
"2022-10-27",2173.7999267578125,2149.8943481445312,1.1119420186351476,10111.194201863515
"2022-10-28",2156.0999755859375,2149.8943481445312,0.28864801876250445,10028.86480187625
"2022-10-31",2176.050048828125,2149.8943481445312,1.2166040022463176,10121.660400224631
"2022-11-01",2215.9000244140625,2149.8943481445312,3.0701823243778246,10307.018232437782
"2022-11-02",2195.9000244140625,2149.8943481445312,2.139904051993834,10213.990405199384
"2022-11-03",2173.7999877929688,2149.8943481445312,1.1119448576191333,10111.194485761913
"2022-11-04",2164.3499755859375,2149.8943481445312,0.6723878061209005,10067.23878061209
"2022-11-07",2158.699951171875,2149.8943481445312,0.40958305857882904,10040.958305857883
"2022-11-09",2154.8499755859375,2149.8943481445312,0.23050562673850508,10023.05056267385
"2022-11-10",2128.8499755859375,2149.8943481445312,-0.9788561273606826,9902.114387263931
"2022-11-11",2202.0999755859375,2149.8943481445312,2.4282880452456825,10242.828804524568
"2022-11-14",2223.8500366210938,2149.8943481445312,3.4399685054472577,10343.996850544725
"2022-11-15",2220.5,2149.8943481445312,3.284145191432548,10328.414519143254
```