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

Reply
Old 07-12-2010, 12:31 PM   #1

cunparis's Avatar

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

Thanks: 238
Thanked 45 Times in 25 Posts

How to Do a Time Stop with Easylanguage

I searched but can't find a way to do a time stop. Is it possible? In fact I'd like to get a lot of info about my trade like:

- time entered
- price
- open profit

I'd like to code my own time stop and trail a breakeven stop.

Thanks
cunparis is offline  
Reply With Quote
Old 07-13-2010, 03:20 AM   #2

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

All possible

Need more specifics.

Lukas
zapisy is offline  
Reply With Quote
Old 07-13-2010, 03:23 AM   #3

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 zapisy »
All possible

Need more specifics.

Lukas
if x minutes have elapsed since entry I want to exit.
cunparis is offline  
Reply With Quote
Old 07-13-2010, 03:35 AM   #4

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,292
Ignore this user

Thanks: 129
Thanked 1,054 Times in 702 Posts

Re: How to Do a Time Stop with Easylanguage

Quote:
Originally Posted by zapisy »
All possible

Need more specifics.

Lukas
Dosen't EL require a 'tick' to do anything? Not sure not something I have done.


Cunparis have you looked at all the date/time functions? Would storing the date time of entry and then comparing the current date time not do the trick? (subject to you getting a 'tic' to trigger your code).
BlowFish is offline  
Reply With Quote
Old 07-13-2010, 03:37 AM   #5

Join Date: Jul 2009
Location: Coimbatore
Posts: 1
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Post Re: How to Do a Time Stop with Easylanguage

Quote:
Originally Posted by cunparis »
I searched but can't find a way to do a time stop. Is it possible? In fact I'd like to get a lot of info about my trade like:

- time entered
- price
- open profit

I'd like to code my own time stop and trail a breakeven stop.

Thanks
code for time stop;

if time 1000 then begin
sell ("Long Exit") current bar at close;
buytocover ("Short Exit") current bar at close;
end;

Arun...
arunsideas@gmail.com
arunsideas is offline  
Reply With Quote
Old 07-13-2010, 03:38 AM   #6

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 BlowFish »
Dosen't EL require a 'tick' to do anything? Not sure not something I have done.


Cunparis have you looked at all the date/time functions? Would storing the date time of entry and then comparing the current date time not do the trick? (subject to you getting a 'tic' to trigger your code).
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).

With ninjatrader it's event driven so I have a method onExecution and I can do whatever I want. in tradestation I use a stop order and I never know when it was filled. the only way I've found is to say

if marketPosition <> 0 then

and that tells me I'm in a position.
cunparis is offline  
Reply With Quote
Old 07-13-2010, 03:46 AM   #7

BlowFish's Avatar

Join Date: Mar 2007
Location: In Da House
Posts: 3,292
Ignore this user

Thanks: 129
Thanked 1,054 Times in 702 Posts

Re: How to Do a Time Stop with Easylanguage

Could you use tick data on data1 and minute data on data2 to trigger signals. I guess not as the time stamp resolution of historical tick data is only 1 minute I think? I hear they are introducing millisecond time stamping at some stage.
BlowFish is offline  
Reply With Quote
Old 07-13-2010, 03:49 AM   #8

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 BlowFish »
Could you use tick data on data1 and minute data on data2 to trigger signals. I guess not as the time stamp resolution of historical tick data is only 1 minute I think? I hear they are introducing millisecond time stamping at some stage.
Minute is fine for me for the time stop. I was hoping there was a secret "EntryTime" variable or something. I find easylanguage great for simple prototypes but almost every time I write a strategy I run into difficulty doing something that would be simple in Ninjatrader. But ninjatrader has a downside in that it takes 50 lines of code to do something simple. However once you have your 50 lines of code options are unlimited.
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.