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

Reply
Old 05-31-2010, 09:27 AM   #1

Join Date: Jul 2009
Location: Paphos
Posts: 36
Ignore this user

Thanks: 9
Thanked 6 Times in 1 Post

Stop After X Profit

Hi All,

Could anyone tell me the line of code that I would need to put into a strategy ( TS 8.6 ) which would instruct the system to not take any further trades today if at least X amount of profit has been generated today.

Many thanks.
nab999 is offline  
Reply With Quote
Old 06-02-2010, 02:50 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: Stop After X Profit

Hi,

This code will give you both.
If you make enough it will stop, and if you lose too much it will stop as well.
If you do not want to use the loss, just put there 10000000

Code:
{***************************** Check For Daily Profit/Loss **************************}
Input:     Profit_For_Day    (500);
Input:     Loss_For_day      (300);
Vars:     TradeSwitch       (True);
 
If Date <> Date[1] Then Begin Value10 = NetProfit; TradeSwitch = True; End;
If (NetProfit - Value10) >= (Profit_For_Day) or (NetProfit - Value10) <= -(Loss_For_day) Then TradeSwitch = False; 
If TradeSwitch = True 
 
    Then Begin
 
    //Your trade conditions here
 
 
end;
www.linetrol.com

. . .
zapisy is offline  
Reply With Quote
The Following 2 Users Say Thank You to zapisy For This Useful Post:
nab999 (06-02-2010), Ranger (06-11-2010)

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
The Race thalestrader Traders Log 758 01-03-2011 02:09 PM
Best Strategy Backtesting Software cowcool Automated Trading 179 09-24-2010 06:00 AM

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