Skip to main content

A. What is an Object?

Posted in

Before we dive in to the four features mentioned in III. Introduction, to discuss Object Oriented Programming we must define what exactly is an "Object".

An object can be considered a group of code, related to one another, to represent an "object or concept in the real world". Most only use the word Object. However, as you read more, I will explain why I mention the term "concept" also.

An object my be a person, car, house, a Tradestation chart, or an MS excel sheet. A concept could be a Vector, a TradeStation Strategy, Indicator, and the such. However, to be consistent with Object Oriented language we will group everything in to an Object. Although as someone's "thought" is not an actual object, it is more of a concept, in the Object Oriented world it would be considered an Object. If a programmer started to design a program to represent people's thoughts, they would design it such that their thoughts are objects. Which is why it's not called Object Concept Oriented Programming. It of course is only called Object Oriented Programming

The actual code implementation, and an actual instance of the object, is created using a "class". Thus, a class simply represents the object in terms of actual lines of code. Whether that code be in Java, C++, C sharp, and OOEL. An example of a class in OOEL is a Vector. To actually use that object, we "instantiate" the class that represents the object.

Lets look at this in TradeStation OOEL. Vector is an Object in programming, the code behind the vector is a class. To create an instance of the Object, we declare a variable to the class, and use the EasyLanguage OOEL key words "new".

Vars:
Vector LastNames(null).

LastNames = newVector;
{This creates an instance of the class Vector. The class vector has been created for us by TradeStation to represent the concept, or should we say object - Vector. In this situation we create an instance to hold Last Names}

See some powerful OOEL Indicators and Strategies "OOEL Indicators and Strategies".