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

Reply
Old 07-24-2008, 01:36 PM   #1

Join Date: Feb 2008
Location: Miami Beach
Posts: 4
Ignore this user

Thanks: 1
Thanked 1 Time in 1 Post

Easy Language Strategy Help

I'm trying to add a daily stop loss or daily profit target to the canned systems in TS 8.3, on an intraday basis. Once this $$$ has been met, I'd like the system to stop trading for that day. Additionally, I'd like the option of having the daily stop loss and daily profit target to be located in the inputs section, so I can optimize them.

I've tried using the SetStopLoss and SetProfitTarget, but they continue to trade again after they have been triggered. They don't stop for the rest of the day.

There is code in the TS forums, but it is several years old and I can't get it to work. I'm not sure if it is because the coding has been updated and its no longer compatible.

Any help would be greatly appreciate.
Marc33139 is offline  
Reply With Quote
Old 07-25-2008, 01:01 AM   #2

Join Date: Jan 2008
Location: San Francisco
Posts: 394
Ignore this user

Thanks: 17
Thanked 338 Times in 156 Posts

Re: Easy Language Strategy Help

you need to add a statement, try:

entriestoday(date)<1;

can add it as a condition like this:

condition1=entriestoday(d ate)<1;

if condition1 then buy next bar at market;

or just add it in to the buy command statement

------

to add anything added to inputs, you need to simply declare that you want then and then define it with a default number.

ie,

inputs: stopout (350);

setstoploss(stopout);

----

good luck
Frank is offline  
Reply With Quote
Old 07-25-2008, 09:10 AM   #3

Join Date: Feb 2008
Location: Miami Beach
Posts: 4
Ignore this user

Thanks: 1
Thanked 1 Time in 1 Post

Re: Easy Language Strategy Help

Thanks for your reply. Much appreciated.
Marc33139 is offline  
Reply With Quote
Old 07-28-2008, 11:35 AM   #4

Join Date: Jan 2007
Location: Los Angeles
Posts: 14
Ignore this user

Thanks: 0
Thanked 1 Time in 1 Post

Re: Easy Language Strategy Help

Here is what I've used in the past.

Code:
inputs:DayProfitlimit(500),DayLossLimit(200)
variables:
	canTrade(0),   
	NP( 0 ),  
	OPP( 0 ),  
	PLB4Today( 0 ),  
	ProfToday( 0 ) ;  
   
NP = NetProfit ;  
OPP = OpenPositionProfit ;  
  
if date <> date[1] then begin  
 	PLB4Today = NP[1] + OPP[1];
    CanTrade=1;
end;
  
ProfToday = NP + OPP - PLB4Today ;



if ProfToday >= DayProfitlimit or ProfToday <= -DayLossLimit then Begin
	cantrade = 0;
end;


// In your trades, check 'Cantrade' before trading..
MseTrap is offline  
Reply With Quote
The Following User Says Thank You to MseTrap For This Useful Post:
FranckT (07-07-2011)

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
Need Assintance with Simple Indikator ( Easy Language ) flyingdutchmen Coding Forum 1 06-30-2008 06:32 PM
Easy ADE Problem bigboy Coding Forum 1 02-08-2008 06:59 PM
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 09:25 PM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.