PSL An Interpretative Programming Language for Financial Portfolio

  • Slides: 18
Download presentation
PSL: An Interpretative Programming Language for Financial Portfolio Simulation and Manipulation Alexander Besidski Xin

PSL: An Interpretative Programming Language for Financial Portfolio Simulation and Manipulation Alexander Besidski Xin Li Jian Huang Wei-Chen Lee

PSL: Motivation Bridge the Gap between Expanding Financial Market (Despite the crash of. COM’s

PSL: Motivation Bridge the Gap between Expanding Financial Market (Despite the crash of. COM’s in NASDAQ index in 2001 … ) l Exploding amount of daily generated financial data from trading front desks and the imperative call for automatic trading systems l Modularization and regulation of the financial securities: stock, bond, mortgages, mutual fund, hedge fund… l And Complexity in existing business software solutions and limited flexibility they provide to external users l Growing size of inexperienced investors and business software users who yet need to manipulate and analyze financial securities l Growing size of newly trained financial engineers and MBA’s who knows nothing or even feel horrified about programming in C++ and Java yet need to perform “quant” jobs in investment banking l

PSL: Overview l l l A Finance Oriented Programming Language Common features as most

PSL: Overview l l l A Finance Oriented Programming Language Common features as most other popular programming languages (types, functions, calculation, control flows, I/O, … ) Built-in Support for Manipulation of Financial Securities (stock & bond) and Portfolios Simulation and Analytical Tools for Financial Instruments Visualization and Computation based on Financial Data

PSL: Language Features l Java-like syntax l Less complicated grammar rules l Strongly typed

PSL: Language Features l Java-like syntax l Less complicated grammar rules l Strongly typed l OOP Interface l Script-like programming style l Intrinsically Expandable

PSL: Tutorial l To declare a stock google = new (Price=150. 0); l To

PSL: Tutorial l To declare a stock google = new (Price=150. 0); l To specify its attributions google. Name=”GOOGLE” google. Return = 5; google. Volatility = 30; l Print our its price google. Price. print();

PSL: Tutorial l To declare a Bond, it’s easy. bond Treasury 10 Y =

PSL: Tutorial l To declare a Bond, it’s easy. bond Treasury 10 Y = new( Coupon=3. 0, Maturity=10, Interest. Rate=5. 0 ); Treasury 10 Y. Name = “Treasury 10 Y”;

PSL: Tutorial l To Declare a portfolio pf = new(Capital=3000. 0); l Set the

PSL: Tutorial l To Declare a portfolio pf = new(Capital=3000. 0); l Set the assets pf. add. Stock(google, 20); pf. add. Bond(Treasury 10 Y, 5); pf. add. Stock(IBM, 8); pf. add. Stock(google, 16); pf. add. Capital(1000. 0);

PSL: Tutorial l Show the final total asset value pf. print. Content(); l Then

PSL: Tutorial l Show the final total asset value pf. print. Content(); l Then Simulate the portfolio’s performance and show them in a chart ("Simulate the portfolio: "). print(); pf. simulate(50);

PSL: Tutorial

PSL: Tutorial

PSL: Geometric Brownian Motion is a model to simulate the behavior of prices of

PSL: Geometric Brownian Motion is a model to simulate the behavior of prices of stocks or other commodities. l The transition from the price at one time to the next is l

PSL: Requirements l Create an Interpreter l Develop in Java l Use ANTLR l

PSL: Requirements l Create an Interpreter l Develop in Java l Use ANTLR l Team work

PSL: Development Environment l Eclipse chosen as main Dev platform l Built in CVS

PSL: Development Environment l Eclipse chosen as main Dev platform l Built in CVS capabilities l Easy integration with ANTLR l Automatic builds l Rapid development and debugging

PSL: Language Components l Frontend - Lexical scanner, Parser, Tree Walker Interpreter Symbol table

PSL: Language Components l Frontend - Lexical scanner, Parser, Tree Walker Interpreter Symbol table Wrapper class for primitive & complex types l Backend – Graphics, Simulation, I/O, Statistics l Testing l Documentation

PSL: Roles l Xin – Dev l Jian – Dev l Peter – QA,

PSL: Roles l Xin – Dev l Jian – Dev l Peter – QA, Doc l Alex – Captain, Dev

PSL: Assignments Primary Secondary Xin Financial Requirements Frontend-Backend integration Walker Jian Backend Peter QA

PSL: Assignments Primary Secondary Xin Financial Requirements Frontend-Backend integration Walker Jian Backend Peter QA Doc Alex Lexer Parser Walker

PSL: Language Structure Dissection l By Value & by Reference semantics l Control Flow

PSL: Language Structure Dissection l By Value & by Reference semantics l Control Flow l Java-style Scoping Rules l Functions l Arrays l Properties and methods for complex types

PSL: Lessons Learned l Financial jargon info. l Tools: ANTLR, ECLIPSE+CVS l Language without

PSL: Lessons Learned l Financial jargon info. l Tools: ANTLR, ECLIPSE+CVS l Language without ambiguous l Regression test module

PSL: Conclusion l White paper- production advocating l LRM- blueprint l PSL- excellent construction

PSL: Conclusion l White paper- production advocating l LRM- blueprint l PSL- excellent construction for extended development