







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








- Jesse Van Marter jjv - Ravie Lakshmanan rl - Ricardo Martinez rmm - Sophie Lucy sjl The financial industry has been a perfect space for the use of programming languages because of the heavy reliance on mathematical calculation and accuracy involved in gaining successful returns. Technology has allowed people to be more precise in their trades and experimental in their strategies. Thanks to the amount of historical as well as real time stock market data publically available, there are infinite possibilities to the application of a financial programming language. By using such resources, we intend to build a language that make it easy for the user to implement complex algorithms to perform sophisticated financial analysis.
order portfolio struct array true false
Boolean Logic Operators
and or not
Branch Control and Loops
if else for while return
Functions
function void return
Built-in Functions
delta stddev correlation covariance regression ewma lma
int
float
bool
null
string
struct A struct is a structure that allows the user to create their own custom data-type. A struct may hold variables and/or functions. The syntax for creating a struct is as follows:
struct studentStruct = { name : string, age : int, func : myfunc //where myfunc is a built-in or user-defined //function }
To access struct fields, use a dot in between the struct and its fields.
e.g. int myAge = studentStruct.age; studentStruct.func();
array
●
portfolio
if
e.g. if(x==2){return true}
else
e.g. if(x==2) {retu rn true} else{return false}
for
The for statement allows for looping over a range of values. The format is as follows:
e.g. for (initiali zation; termination; update) { stmt }
The initialization begins the for statement and is executed only once (before the loop begins).
The termination is a boolean expression that is checked for before each loop. When it returns false, the loop terminates.
The update is an expression that occurs once after each loop, and should modify the variable(s) being checked for in the termination.
while
The while statement is used for looping so long as a boolean expression inside of the while statement evaluates to true. The syntax is as follows:
e.g. while (expression) { stmt }
return
The return keyword is used both in function declarations, and inside of functions to return a value. The syntax is as follows:
return expr;
= equal to == logical equal to != not equal to < less than <= less than or equal to
greater than = greater than or equal to
and
e.g. 0 and 1 evaluates to 0(false)
or
e.g. 1 or 0 evaluates to 1(true)
not
e.g. not 1 evaluates to 0
ewma
lma
Functions are defined in the following format:
function
e.g. function max( float a, float b) return (flo at) { //Statement list if(a > b ) {return a;} else{return b;}; }