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

Reply
Old 07-13-2010, 04:23 AM   #9

Tams's Avatar

Join Date: Sep 2008
Location: Geelong
Posts: 3,779
Ignore this user

Thanks: 2,084
Thanked 1,474 Times in 912 Posts

Re: How to Do a Time Stop with Easylanguage

Quote:
Originally Posted by cunparis »
This is my problem with easylanguage. I don't think it gets ticks when backtesting, at least not using minute bars (I know one can use the look inside but that's limited to 6 months for tick data).
....
forget about backtesting... that's an idea from the last century. It is only good for high level concept proofing, not tick level testing.

for code verifications, you have to do forward testing.
__________________



Only an idiot would reply to a stupid post

Last edited by Tams; 07-13-2010 at 04:50 AM.
Tams is offline  
Reply With Quote
Old 07-13-2010, 04:32 AM   #10

cunparis's Avatar

Join Date: May 2008
Location: Paris
Posts: 154
Ignore this user

Thanks: 238
Thanked 45 Times in 25 Posts

Re: How to Do a Time Stop with Easylanguage

Quote:
Originally Posted by Tams »
forget about backtesting... that's an idea from the last century. It is only good for concept proofing.

for code verifications, you have to do forward testing.
I'm concept proofing.
cunparis is offline  
Reply With Quote
Old 07-13-2010, 06:15 AM   #11

zapisy's Avatar

Join Date: Jan 2009
Location: New York
Posts: 81
Ignore this user

Thanks: 6
Thanked 26 Times in 17 Posts

Re: How to Do a Time Stop with Easylanguage

Quote:
Originally Posted by cunparis »
if x minutes have elapsed since entry I want to exit.
Code:
{simple entry}
If marketposition=0 and C>O then buy this bar on close;
If marketposition=0 and C<O then sellshort this bar on close;

{exit}
var: 
	NumDays( 0 ), 
	NumHours( 0 ), 
	NumMinutes( 15 ) ;

variables: 
	RawDays( 0 ), 
	RawMinutes( 0 ), 
	ExtraDays( 0 ), 
	TotalMinutes( NumHours * 60 + NumMinutes ) ;

if MarketPosition = 1 then
	begin
	RawDays = DateToJulian( Date ) - DateToJulian( EntryDate ) ;
	RawMinutes = TimeToMinutes( Time ) - TimeToMinutes( EntryTime ) ;
	ExtraDays = RawDays - NumDays ;
	if ExtraDays >= 0 and RawMinutes + ExtraDays * 1440 >= TotalMinutes then
		Sell ( "Time Exit LX" ) next bar at market ;
	end ;

if MarketPosition = -1 then
	begin
	RawDays = DateToJulian( Date ) - DateToJulian( EntryDate ) ;
	RawMinutes = TimeToMinutes( Time ) - TimeToMinutes( EntryTime ) ;
	ExtraDays = RawDays - NumDays ;
	if ExtraDays >= 0 and RawMinutes + ExtraDays * 1440 >= TotalMinutes then
		Buy To Cover ( "Time Exit SX" ) next bar at market ;
	end ;
zapisy is offline  
Reply With Quote
Old 07-13-2010, 07:03 AM   #12

cunparis's Avatar

Join Date: May 2008
Location: Paris
Posts: 154
Ignore this user

Thanks: 238
Thanked 45 Times in 25 Posts

Re: How to Do a Time Stop with Easylanguage

Ok I feel silly.

I upgraded to TS 8.8 which separates the easylanguage editor into a separate application. BTW So far I'm not liking this "feature" because it takes 10 seconds to open it. But anyway, apparently the help file was split into two, one for easylanguage and one for tradestation non-easylanguage (before there was only one).

So searching the TS help doesn't have anything for entryTime but inside the new TS IDE it does.

Thanks!
cunparis 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
Increasing Your Position Size Over Time Dinerotrader Money Management 62 03-31-2012 03:54 PM
Pace of Tape - Measure Trade Intensity to Detect Reversals cunparis Trading Indicators 37 09-03-2010 05:06 AM
NumericSeries and Arrays in Easylanguage nsvv Automated Trading 10 07-13-2010 03:39 AM
Re: Best Times of Day to Trade the Futures? tjnoon Ultimate Trade Analyzer 7 06-27-2010 06:02 PM
Easylanguage at What Price trader273 Coding Forum 1 05-22-2010 11:23 PM

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