Monday, June 25, 2018

public provident fund (ppf) vs mutual funds (mf) ppf vs mf 2018

I am showing you 12 years worth of analysis between PPF and Mutual Funds. 

If you invest 1,50,000 INR today then as per current interest rates and descreasing trend observed in PPF interest rates over the past few years due to inflation you might end up with approximately 3.1 lacs after 12 years. 

On the other hand if you invest same amount in Mutual Funds and assumed return in 3 years (ELSS scheme) is 15% plus or minus 5% then over the period of 12 years you will have approximately 2.6 lacs in hand. 

This analysis is as per current market treand and It does not claim any guarantee in genuinity of these numbers. 

Year PPF
Mutual Funds

investment % rate of interest amount
investment % return amount
1 150000.0 7.6 161400.0
150000 15 172500
2 161400.0 7.4 173343.6

0 172500
3 173343.6 7.2 185824.3

0 172500
4 185824.3 7 198832.0
172500 13 194925
5 198832.0 6.8 212352.6

0 194925
6 212352.6 6.6 226367.9

0 194925
7 226367.9 6.4 240855.4
194925 14 222214.5
8 240855.4 6.2 255788.5

0 222214.5
9 255788.5 6 271135.8

0 222214.5
10 271135.8 5.8 286861.7
222214.5 20 266657.4
11 286861.7 5.6 302925.9

0 266657.4
12 302925.9 5.4 319283.9

0 266657.4

As per my personal opinion and experience in long run I see better returns on investment in PPF over Mutual Funds.

Leave your comments for discussion. 

Sunday, January 21, 2018

Jan 2018 Stocks: picks for the week 3



STOCK CMP ACTION SL TGT LOT SIZE MARGIN
ITC 274.1 BUY 263 285 2400 82000
PVR 1472.75 BUY 1420 1532 400 74000
REPCOHOME 686.4 BUY 655 720 900 77000
UPL 803.3 BUY 769 840 1200 121000
BATAINDIA 718.5 SELL 745 685 1100 100000
BEML 1516.6 SELL 1605 1405 300 57000
NTPC 172.65 SELL 180 166 4000 86000
PFC 120.6 SELL 126 112 6000 90500

Monday, January 15, 2018

Jan 2018 Stocks: picks for the week


Top 10 Large-cap stock picks

STOCK CMP ACTION SL TGT LOT SIZE MARGIN
HINDZINC 324.8 BUY 315 339 3200 129200
KOTAKBANK 1021 BUY 989 1060 800 102000
LT 1330.15 BUY 1290 1379 750 125000
MARUTI 9492.45 BUY 9200 10050 75 88500
PIDILITIND 907.95 BUY 877 950 1000 113500
LUPIN 921.35 SELL 966 865 600 70000
MARICO 314.2 SELL 328 298 2600 103000
POWERGRID 197.25 SELL 203 189 4000 99000

Tuesday, July 11, 2017

LEARNING IN DATA SCIENCE: MODELS, ALGORITHMS AND TOOLS

LEARNING IN DATA SCIENCE: MODELS, ALGORITHMS AND TOOLS

Goal: The SEAS is delighted to announce an intensive school on Pattern Recognition. This school blends theoretical and practical aspects of Data science with focus on models, tools and techniques in data science illustrated through problems in pattern matching and pattern recognition with applications in Computer Science, Bioinformatics/Computational Biology and Image Processing.
This school is led by experts from both industry and academia and will be an immersive experience in theoretical and practical aspects of Data science for advanced UG/PG students and faculty members in Computer Science / Mathematics. This school will be an opportunity for prospective researchers to get a rigorous introduction into the fast emerging field of Data Science.


Call for participation in LEARNING IN DATA SCIENCE: MODELS, ALGORITHMS AND TOOLS
Details at https://sites.google.com/view/seasschool2017

Monday, July 10, 2017

Connecting PHP with MySQL

Connecting PHP with MySQL

Content

* Connectivity
* Selecting Database
* Insert, Update and Delete
* Select data from database
* Sample Application

Connectivity

* PHP provides several predefined functions to access MySQL, but before accessing MySQL, application need to connect MySQL as a user (similar to login from MySQL client)
* To establish connection between PHP and MySQL, PHP provides fine tuned methods like mysqli_connect().

mysqli_connect()

* Following is the format of mysqli_connection function
mysqli_connect(host,username,password,dbname);
* host: host ip address of database server, in our case it is localhost 
* username: Name of the MySQL user
* password: Password of the user
* dbname: Database name (optional)
Example
<?php 
     $con=mysqli_connect('localhost','root');
    if(!$con)
  echo "Connection failed";
    else
  echo "Connection done";
?> 

mysqli_close()

* This method is used to disconnect PHP with MySQL, similar to logout.

mysqli_close($con); 

Example

<?php 
$con=mysqli_connect('localhost','root');
     if(!$con)
  echo "Connection failed";
     else
  echo "Connection done";
/* do needful database operations here */
    mysqli_close($con); 
?>

Selecting Database

* We can select database after getting connection, using mysqli_select_db() method
mysqli_select_db($con,$databsename);

Insert, Update and Delete

* We can insert, update or delete data using mysqli_query() method. 
mysqli_query($con,$query);
* $query is query string, it can be any insert, update or delete sql statement.

Select data

* Selecting data is somewhat requires more handling, as the result of execution of select query, we may get several rows of a table.

$result = mysqli_query($con,$query);

* mysqli_query() method returns extracted data as two dimensional associative array.
$row=mysqli_fetch_array($result);

* We can fetch first row as an array of values using method mysqli_fetch_array()

* you can also count number of rows using mysqli_num_rows() method
$num=mysqli_num_rows($result);

Sample Application

* Application gives interfaces to the user to manage book records. The following functionalities must be provided:
 - Insertion of new book record
 - Deletion of record
 - Updation of record
 - View all records
 - Search book records

* First of all create a database 'library'.
* Create a table 'book' in the 'library' database.

* Columns: 
 - bookid int(5) AUTO_INCREMENT PK
 - title varchar(255)
 - price float(6,2)

* Define following php files:
 - home.php
 - insert.php
 - delete.php
 - update.php
 - bookfun.php

home.php

<?php include('bookfun.php'); ?>
<html>
 <head>
  <title> Book Store Management</title>
  <style type="text/css">
   #buttons
   {
     margin-left:50px;
     width:50%;
     border:2px solid silver;
   }
   #activityarea
   {
     margin-left:50px;
     width:50%;
     border:2px solid silver;
     height:50%;
   }
   table {
    position:relative; 
    left:25%;
    width:300px;
   }
   #insertform { display:none;}
   #back {display:none;}
   #view,#edit,#delete {display:none;}
   #view table{ border:2px solid navy; }
   #view table th {background-color:orange;}
   #view table td {background-color:khaki;}
  </style>
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript">
   $(document).ready(function(){
     $("button").click(function(){
      if($(this).html()=="Insert")
       {
          $("#insertform").show();
   $(".b1").hide();
          $("#back").show();
       } 
     
      if($(this).html()=="View")
       {
          $("#view").show();
   $(".b1").hide();
          $("#back").show();
       }

      if($(this).html()=="Edit")
       {
          $("#edit").show();
   $(".b1").hide();
          $("#back").show();
       } 
      if($(this).html()=="Delete")
       {
          $("#delete").show();
   $(".b1").hide();
          $("#back").show();
       } 
     });
     $("#back").click(function(){
          $("#insertform").hide();
          $("#view").hide();
          $("#edit").hide();
          $("#delete").hide();
   $(".b1").show();
          $("#back").hide();  
     });     
   });
  </script>
 </head>
 <body>
  <h1> Book Store Management</h1>
  <div id="buttons">
   <button class="b1">Insert</button>
   <button class="b1">View</button>
   <button class="b1">Edit</button>
   <button class="b1">Delete</button>
   <button id="back">Back</button>
  </div>
  <div id="activityarea">
   <form id="insertform" action="insert.php" method="post">
    <table>
     <tr>
 <td>Book Title</td>
 <td><input type="text" name="title"/></td>
     </tr>
     <tr>
 <td>Price</td>
 <td><input type="text" name="price"/></td>
     </tr>
     <tr>
 <td></td>
 <td><input type="submit" value="store"/></td>
     </tr>
    </table>
   </form>
   <div id="view" > <?php viewbook(); ?></div>
   <div id="edit" > <?php editbook(); ?></div>
   <div id="delete" > <?php deletebook(); ?></div>
  </div>
 </body>
</html>

insert.php

<?php
  $title=$_POST['title'];
  $price=$_POST['price'];
  $con=mysql_connect('localhost','root');
  if(!$con)
   echo "Could not connect";
  mysql_select_db("lms",$con);
  $q="insert into book (title,price) values ('$title',$price)";
  mysql_query($q);
  mysql_close($con);
  header('location:http://localhost/ex2/home.php');
?>

update.php

<?php
 /* extracting HTML form data */
 $i=1;
 while(isset($_POST["title".$i]))
 {
  $bookid[$i]=$_POST["bookid".$i];
  $title[$i]=$_POST["title".$i];
  $price[$i]=$_POST["price".$i];
  $i++;
 }
 $length=$i-1;
/* Establishing Connection */
   $con=mysql_connect('localhost','root');
   if(!$con)
    echo "Could not connect";
   mysql_select_db("lms",$con);
  for($i=1;$i<=$length;$i++)
  {
   $q="update book set title='"."$title[$i]"."' ,price=$price[$i] where bookid=$bookid[$i]";
   mysql_query($q);
  }
  mysql_close($con);
  header('location:http://localhost/ex2/home.php');
?>

delete.php

<?php
 /* extracting HTML form data */
 $i=1;
 $j=1;
 while(isset($_POST["title".$i]))
 {
  if(isset($_POST["cb".$i]))
  {
   $bookid[$j]=$_POST["bookid".$i];
   $title[$j]=$_POST["title".$i];
   $price[$j]=$_POST["price".$i];
   $j++;
  }
  $i++;
 }
 $length=$j-1;
/* Establishing Connection */
   $con=mysql_connect('localhost','root');
   if(!$con)
    echo "Could not connect";
   mysql_select_db("lms",$con);
  for($j=1;$j<=$length;$j++)
  {
   $q="delete from book where bookid=$bookid[$j]";
   $s= mysql_query($q);
  }
  mysql_close($con);
  header('location:http://localhost/ex2/home.php');
?>

bookfun.php

<?php
/* Function 1*/
 function viewbook()
 {
  $con=mysql_connect('localhost','root');
  if(!$con)
   echo "Could not connect";
  mysql_select_db("lms",$con);
  $q="select * from book";
  $result=mysql_query($q);
?>
 <table>
  <tr><th>Title</th><th>Price</th></tr>
<?php
  while($row=mysql_fetch_array($result))
  {
  echo "<tr><td>".$row['title']."</td><td>".$row['price']."</td></tr>";
  }
  echo "</table>";
 }
?>

<?php 
/* Function2*/
  function editbook()
  { 
   $con=mysql_connect('localhost','root');
   if(!$con)
    echo "Could not connect"; 
   mysql_select_db("lms",$con);
   $q="select * from book";
   $result=mysql_query($q);
?>
 <form action="update.php" method="post">
 <table>
  <tr><th></th><th>Title</th><th>Price</th></tr>
<?php
  $i=0;
  while($row=mysql_fetch_array($result))
  {
   $i++;
   echo "<tr><td><input type='hidden' value='".$row['bookid']."' name='bookid".$i."' /></td>";
   echo "<td><input type='text' value='".$row['title']."' name='title".$i."'/></td><td><input type='text' value='".$row['price']."' name='price".$i."' /></td></tr>";
  }
?>
 <tr><td></td><td></td><td><input type="submit" value="save" /></td></tr>
<?php  
  echo "</table></form>";    
  }
?>

<?php
  /* function 3 */
 function deletebook()
 {
   $con=mysql_connect('localhost','root');
   if(!$con)
    echo "Could not connect"; 
   mysql_select_db("lms",$con);
   $q="select * from book";
   $result=mysql_query($q);
?>
 <form action="delete.php" method="post">
 <table>
  <tr><th></th><th>Title</th><th>Price</th></tr>
<?php
  $i=0;
  while($row=mysql_fetch_array($result))
  {
   $i++;
   echo "<tr><td><input type='checkbox' name='cb".$i."' /><input type='hidden' value='".$row['bookid']."' name='bookid".$i."' /></td>";
   echo "<td><input type='text' value='".$row['title']."' name='title".$i."'/></td><td><input type='text' value='".$row['price']."' name='price".$i."' /></td></tr>";
  }
?>
 <tr><td></td><td></td><td><input type="submit" value="Delete" /></td></tr>
<?php
  echo "</table></form>";    
 }
?>

* Do not forget to include jquery.js file

<<Prev     Home     Next>>

Stocks of the week: July 10




* Stock selection will be made from NSE F&O. The levels mentioned will be of the spot market.
* The report will be released every week.
* Recommendations will be mix of Long & Short position based upon market condition.
* The minimum risk-reward ratio in the each recommendation shall be maintained at 1:1.5.
* The stock should get initiated on the first trading day of the week, or else will be taken as not Initiated.
* The position will be closed on achieving mentioned levels and rest all open positions will be closed on the last trading day of the week by 3 P.M.
* The report will be communicated through this website.

STOCK CMP ACTION SL TGT LOT SIZE MARGIN
AMARAJABAT 860.95 BUY 832 908 600 64100
BHARTIARTL 385.45 BUY 372 408 1700 81700
CANBK 340.3 BUY 330 360 3084 131000
DRREDDY 2693.75 BUY 2585 2860 200 67100
MARUTI 7454.9 BUY 7199 7900 150 140300
TATACHEM 651.8 BUY 629 689 1500 121900
VEDL 258.55 BUY 244 281 3500 114300
ONGC 160.05 SELL 166 151 3750 75400

Refers to (if any call is not initiated, entry levels for the recommendation(s) will be sent on the trading terminal(s)CMP: Current Market Price| ENT : Entry | SL: Stop Loss | TGT: Target  | ABV: Above| BLW: Below | CD: Consumer Durables |BFSI: Banking and Financial Services| FMCG: fast Moving Consumer Goods | MISC : Miscellaneous | ANCL : Ancillaries | * The mentioned levels are future levels and the stocks will be initiated during the market hours.