Welcome to the Traders Laboratory Forums.
Coding Forum Collaborate, receive help, or discuss coding related issues.

Like Tree2Likes

Reply
Old 10-30-2011, 01:06 AM   #25



Join Date: Apr 2010
Posts: 1,103
Ignore this user

Thanks: 125
Thanked 392 Times in 224 Posts

Re: Object-Oriented Programming OOP

Quote:
Originally Posted by Tradewinds »
I can not use:
tsdata.trading.Order.Canc el
But I CAN do this:
MyOrder.Cancel
I don't know why those two are not interchangeable.
Type defines the properties\functions\even ts\etc of an object - like a blueprint.
But an object is an instance of the Type - like a house.

Maybe another analogy will help here ...

tsdata.trading.Order == 'Human'
MyOrder == 'Mark'

So MyOrder is an instance of Type tsdata.trading.Order
just as 'Mark' is an instance of Type 'Human'

So therefore you can call 'MyOrder.Cancel'
just like you can call 'Mark.Walk'

But 'Human.Walk' doesn't make sense because 'Human' is just a definition. 'Mark' is the instance of that definition. Thats why you can't call 'tsdata.trading.Order.Can cel'

MMS
__________________
Traders Laboratory is 100% Free due to our generous ad sponsors.
Be sure to support them - they support Traders Laboratory!

Featured Brokers include:
Alpari | Mirus Futures

Featured Services:
NinjaTrader | Kinetic | INO Trading Course
MadMarketScientist is offline  
Reply With Quote
The Following User Says Thank You to MadMarketScientist For This Useful Post:
Tradewinds (10-31-2011)
Old 10-31-2011, 10:04 PM   #26

Tradewinds's Avatar

Join Date: Nov 2008
Location: Northeast U.S.
Posts: 891
Ignore this user

Thanks: 373
Thanked 231 Times in 164 Posts
Blog Entries: 6

Re: Object-Oriented Programming OOP

Quote:
Originally Posted by MadMarketScientist »
Type defines the properties\functions\even ts\etc of an object - like a blueprint.
But an object is an instance of the Type - like a house.

Maybe another analogy will help here ...

tsdata.trading.Order == 'Human'
MyOrder == 'Mark'

So MyOrder is an instance of Type tsdata.trading.Order
just as 'Mark' is an instance of Type 'Human'

So therefore you can call 'MyOrder.Cancel'
just like you can call 'Mark.Walk'

But 'Human.Walk' doesn't make sense because 'Human' is just a definition. 'Mark' is the instance of that definition. Thats why you can call 'tsdata.trading.Order.Can cel'

MMS
Good explanation. The part about "Human.Walk" makes sense to me. The category 'Human' is to broad, and not specific to one 'instance'. The only way that "Human.Walk" would work, is if it forced all humans on the entire planet to walk. But that wouldn't be very beneficial. It would be like giving the order, All_TL_Members.Post That would be a nightmare. LOL It's better to use: MMS.Post Then we can make some progress.

tsdata.trading.Order.Canc el would need to cancel every single order. There could be OrderOne, OrderTwo, OrderFutures, OrderStocks, etc. There might be times when you might want to cancel all orders, but you would want a specific command for that. It's important to be able to control one specific instance of something, so there needs to be a way to label and refer to that specific instance.
__________________
Precise, "dialed-in", targeted combination setups, like opening a combination lock; is the experience you should be having while trading. Dial left, right, left, . . . click - the lock opens.
Tradewinds is offline  
Reply With Quote
Old 11-06-2011, 11:22 AM   #27



Join Date: Apr 2010
Posts: 1,103
Ignore this user

Thanks: 125
Thanked 392 Times in 224 Posts

Re: Object-Oriented Programming OOP

Quote:
Originally Posted by Tradewinds »
It's important to be able to control one specific instance of something, so there needs to be a way to label and refer to that specific instance.
Yup that is essentially Object Oriented Programming ... the Objects are the individual instances of a Class. You never really 'control' all the instances of a Class (Human) just the individual instances of the class (Mark)

regards,
MMS
Tams likes this.
__________________
Traders Laboratory is 100% Free due to our generous ad sponsors.
Be sure to support them - they support Traders Laboratory!

Featured Brokers include:
Alpari | Mirus Futures

Featured Services:
NinjaTrader | Kinetic | INO Trading Course
MadMarketScientist is offline  
Reply With Quote

Reply

Thread Tools
Display Modes Help Others By Rating This Thread
Help Others By Rating This Thread:


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming: Where to Start? Soultrader Coding Forum 40 02-22-2012 10:13 AM
EasyLanguage Going Object Oriented ! Tams Tools of the Trade 24 07-03-2010 09:49 AM
Text Object PeterBrazel Coding Forum 0 01-28-2010 09:51 PM
Truncate EL Text Object PeterBrazel Coding Forum 3 08-01-2009 10:38 AM
Programming Your System brownsfan019 Tools of the Trade 17 04-22-2008 09:49 AM

All times are GMT -4. The time now is 11:05 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.