Welcome to the Traders Laboratory Forums.
Automated Trading Black box systems, strategy automation, algorithmic trading, etc...

Reply
Old 11-12-2008, 04:14 PM   #1

JKLM's Avatar

Join Date: Nov 2008
Location: ST
Posts: 47
Ignore this user

Thanks: 14
Thanked 34 Times in 19 Posts

Easy Language Help

how can I code that after profit target ocurs, system take only oposite direction orders or better that exit

so if I was long and I hit profit target at 100 , next order I will take is short or long but blow 100 ..say 99

thanks
JKLM is offline  
Reply With Quote
Old 11-13-2008, 07:03 PM   #2

JKLM's Avatar

Join Date: Nov 2008
Location: ST
Posts: 47
Ignore this user

Thanks: 14
Thanked 34 Times in 19 Posts

Re: Easy Language Help

maybe I was no clear enough because of my bad english ...sorry

so how can I code this:
after profit target occurs, system can take only opposite direction orders or better than last exit in same direction

so if I was long and I get profit target at 100, next order I will take is only short or long but below 100 ...lets say 99

thanks
JKLM is offline  
Reply With Quote
Old 11-13-2008, 07:31 PM   #3

januson's Avatar

Join Date: Mar 2007
Location: Denmark - Copenhagen
Posts: 107
Ignore this user

Thanks: 0
Thanked 4 Times in 4 Posts

Re: Easy Language Help

Just create a variable, initialize it for instance with -1 and set it to 100 after long exit!

var: LastExitPrice(-1);

entry rule...
if yada.... and LastExitPrice = -1 or Close < LastExitPrice then
if conditions is met for long then....
entry...
if conditions is met for short then...
entry...
exit rule:
... yada... if... then exit position...
begin
Sell("....") next bar at market;
LastExitPrice = Close;
End;

Remember to reset LastExitPrice at the end of the day/ week or whatever
januson is offline  
Reply With Quote
The Following User Says Thank You to januson For This Useful Post:
JKLM (11-13-2008)
Old 11-14-2008, 06:10 AM   #4

JKLM's Avatar

Join Date: Nov 2008
Location: ST
Posts: 47
Ignore this user

Thanks: 14
Thanked 34 Times in 19 Posts

Re: Easy Language Help

thanks this really helps me alot

and how would you code if I want take only opposite orders after profit target
JKLM is offline  
Reply With Quote
Old 11-14-2008, 11:49 AM   #5

januson's Avatar

Join Date: Mar 2007
Location: Denmark - Copenhagen
Posts: 107
Ignore this user

Thanks: 0
Thanked 4 Times in 4 Posts

Re: Easy Language Help

If only!! then I would create another variable:

vars: LastOrderType("unknown");

And then write long entry og short entry into that each time a trade is initiated.

Remember again to reset variable if the price is lower than, for instance 3%

if Close < LastExitPrice -3% and LastOrderType = "Long" then
LastOrderType = "unknown";

Otherwise you will presumeable only get one long entry
januson is offline  
Reply With Quote
The Following User Says Thank You to januson For This Useful Post:
JKLM (11-14-2008)
Old 02-10-2009, 02:49 AM   #6

Join Date: Jun 2008
Posts: 1
Ignore this user

Thanks: 1
Thanked 0 Times in 0 Posts

Re: Easy Language Help

Hi, sorry to post in this thread. i am new to program trading but like to start with the follow setup using tradestation easy language,

when rsi hit 90, sell one ES contract.profit 4 ticks and stop loss 4 ticks.
when rsi hit 20, buy one ES contract.profit 4 ticks and stop loss 4 ticks.

anyone can advice or give some pointers? appreciate,thanks.cwk
chikwk is offline  
Reply With Quote
Old 02-10-2009, 09:06 AM   #7

Tams's Avatar

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

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

Re: Easy Language Help

Quote:
Originally Posted by chikwk »
Hi, sorry to post in this thread. i am new to program trading but like to start with the follow setup using tradestation easy language,

when rsi hit 90, sell one ES contract.profit 4 ticks and stop loss 4 ticks.
when rsi hit 20, buy one ES contract.profit 4 ticks and stop loss 4 ticks.

anyone can advice or give some pointers? appreciate,thanks.cwk
you should start by looking at some of the canned codes that came with the program.
there are a few examples that follow your chain of thought.
Tams is offline  
Reply With Quote
Old 02-10-2009, 11:17 PM   #8

Join Date: May 2008
Location: amsterdam
Posts: 114
Ignore this user

Thanks: 25
Thanked 38 Times in 30 Posts

Re: Easy Language Help

Quote:
Originally Posted by chikwk »
Hi, sorry to post in this thread. i am new to program trading but like to start with the follow setup using tradestation easy language,

when rsi hit 90, sell one ES contract.profit 4 ticks and stop loss 4 ticks.
when rsi hit 20, buy one ES contract.profit 4 ticks and stop loss 4 ticks.

anyone can advice or give some pointers? appreciate,thanks.cwk

if rsi(close,14) crossesover 90 then shortsell this bar on close
else
if rsi(close,14) crossesunder 20 then buy this bar on close;

i don't need to see a backtest of this, do NOT trade this
flyingdutchmen is offline  
Reply With Quote
The Following User Says Thank You to flyingdutchmen For This Useful Post:
chikwk (02-11-2009)

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
List of Easy Language Reserved Words trbates Beginners Forum 15 12-11-2009 11:44 AM
Easy Language in OEC, Help with Channel Indicator popstocks Coding Forum 10 11-07-2008 06:09 PM
Easy Language Strategy Help Marc33139 Automated Trading 3 07-28-2008 11:35 AM
Accessing Market Indices in Easy Language goldspot Technical Analysis 3 12-26-2007 11:01 PM
Easy Language - Help with Simple System gatrader E-mini Futures Trading Laboratory 8 12-17-2007 06:40 PM

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