Welcome to the Traders Laboratory Forums.
TradeStation Custom Programming Discuss projects, ideas, obstacles in programming with TradeStation.

Reply
Old 08-29-2011, 12:31 AM   #1

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

Timer Class

TS version 9 is no longer dependent upon the bar in the chart to move for the code to recalculate. TS 9 now had object oriented programing with Namespaces, Classes, Methods, Properties and Events.
There is now a new "Timer" Class Component.
Here are some lines of code taken from an example. The lines of code show the syntax and some different things that you can do with the timer. It's not functioning code. I'm still learning how to use it, so I hope what I've provided is correct.

using elsystem; // "elsystem" is the Namespace. This statement is placed at the beginning of your code. This allows you to reference the methods, properties and events of the namespace "elsystem" in future lines of code.
vars: Timer Timer1(null); // Declare a Timer variable named "Timer1" and set it's initial value to null.
Timer1 = new elsystem.Timer; // Create the new Timer
Timer1.Interval = 1 * 1000; // Set timer to update every second
Timer1.Enable = true; // Start the timer
Timer1.Elapsed += Timer1_Elapsed; // Calls the Method subroutine "Timer1_Elapsed" when the timer expires
Timer1.Enable = false; //Turn timer off
Timer1.Enable = true; //Turn timer back on
__________________
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

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
Bar Countdown Timer Tradewinds TradeStation Custom Programming 5 08-17-2011 10:20 PM
Morgan Business Trial Group Files Class Action Against Forex Capital Markets, LLC Mysticforex Brokers and Data Feeds 2 05-09-2011 05:40 AM
Rich Dading Trading Class Real/ newtrader001 Beginners Forum 10 11-12-2010 11:03 AM
Minute Timer for Tradestation Soultrader Trading Indicators 3 03-25-2009 01:56 PM
Neat High School Class Pit Trading brownsfan019 General Discussion 8 01-04-2009 09:21 AM

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