Unformatted text preview:

Uniform General Algorithmic UNIGA Financial Trading Language Language Reference Manual Leon Wu llw2107 columbia edu Jiahua Ni jn2173 columbia edu Jian Pan jp2472 columbia edu Yang Sha ys2280 columbia edu Yu Song ys2310 columbia edu Columbia University in the City of New York Introduction Today many financial firms have their own trading software tools to facilitate investors investment process These tools often differ from each other and usually take a long time to learn They are also not easy to be customized and very expensive Many institutional and individual investors have their own custom designed investment strategies They want to implement their investment strategies using some easy to use software with low cost However designing financial trading software from scratch requires professional knowledge and can be costly and time consuming The UNIGA Language provides an easy and efficient way for people to design their own investment plans The language allows users to write a program that can automatically trade financial instruments including Stock Options Bonds and Mutual Funds etc using pre defined trading strategy that defines trading rules such as set price sell price comparisons quantity and other elements Overview of this Language UNIGA is a high level scripting language Script programming languages enable programmers to specify trading operations intuitively Although not as comprehensive as the more well known scripting languages such as Perl or Python the built in keywords make the language more intuitive and easy to use The user is able to design trading software in the form of a program The translator will then output a Java source file that can be edited and compiled into Java byte code 1 Lexicon 1 1 Identifiers Identifiers consist of a sequence of one or more uppercase or lowercase alphabetic characters digits 0 to 9 The first character of an identifier should be a letter and cannot be a number Identifiers are case sensitive upper case and lower case letters are treated differently Keywords are not identifiers 1 2 Keywords The following identifiers are reserved as keywords boolean if while open low double else function close sell date for return volume buy void break market high 1 3 Numbers A number consists of digits decimal point All numbers in our language are implemented as double precision floating point numbers by default 1 4 String literals Strings are sequences of zero or more characters String literals are character strings surrounded by quotation marks String literals can include any valid character including white space characters and character escape sequences 1 5 Operators An operator is a token that specifies an operation on at least one operand and yields some result a value designator side effect or some combination Operands are expressions or constants a form of expression Operators in UNIGA are 2 Data Types We have defined our data type as follows Numeric double to represent date time price trade volume and its array double True False Boolean values there s no array for this data type 3 Declarations 3 1 General type declaration The general syntax of a declaration is as follows declaration type specifier init declarator list opt init declarator list declarator init declarator list declarator Type specifiers are double boolean 3 2 Declaring Arrays Arrays are declared with the bracket punctuators as shown in the following syntax type specifier declarator constant expression list opt 4 Functions 4 1 Function Calls A function call is a primary expression usually a function identifier followed by parentheses which is used to invoke a function The parentheses contain a possibly empty comma separated list of expressions that are the arguments to the function 4 2 Functions Types A function has the derived type function returning type The type can be any data type except array types or function types If the function returns no value its type is function returning void sometimes called a void function Functions can be introduced into a program in one of two ways 1 A function definition can create a function designator define its parameters and their type define the type of its return value and supply the body of the function 2 A function declaration announces the properties of a function defined elsewhere 4 3 Function Definitions A function definition includes the code for the function Function definitions can appear in any order and in one source file or several although a function cannot be split between files Function definitions cannot be nested A function definition has the following syntax function definition function declaration specifiers opt declarator declaration list opt compound statement declaration specifiers The declaration specifiers type qualifier and type specifier can be listed in any order Type specifiers are double boolean Type qualifiers are const Example main buy MSFT 100 buy MSFT Max 100 50 function double Max x y if x y then return x else return y 4 4 Function Declarations For all functions if the function definition is located after the calling function in the source code the function must be declared before calling it 4 5 Function Parameters and Arguments UNIGA functions exchange information by means of parameters and arguments The term parameter refers to any declaration within the parentheses following the function name in a function declaration or definition the term argument refers to any expression within the parentheses of a function call The following rules apply to parameters and arguments of UNIGA functions z Except for functions with variable length argument lists the number of arguments in a function call must be the same as the number of parameters in the function definition This number can be zero z The maximum number of arguments and corresponding parameters is 50 for a single function z Arguments are separated by commas However the comma is not an operator in this context and the arguments can be evaluated by the compiler in any order There is however a sequence point before the actual call z Arguments are passed by value that is when a function is called the parameter receives a copy of the argument s value not its address This rule applies to all scalar values structures and unions passed as arguments z Modifying a parameter does not modify the corresponding argument passed by the function call 4 6 Function invocation and return Function call A function call can be a single statement followed by a Return


View Full Document

Columbia COMS W4115 - Uniform General Algorithmic (UNIGA)

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Loading Unlocking...
Login

Join to view Uniform General Algorithmic (UNIGA) and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Uniform General Algorithmic (UNIGA) and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?