Welcome to the Traders Laboratory Forums.
TradeStation Custom Programming Discuss projects, ideas, obstacles in programming with TradeStation.

Reply
Old 08-17-2011, 04:46 PM   #1

Join Date: Aug 2011
Posts: 3
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

SetProfitTarget SetStopLoss

Hi,
How do I set a profit target and stop loss for long, and different target and stop loss for short? Right now, I call setProfitTarget and setStopLoss, and they set a global target and stop loss.

Thanks
dumpforjunk is offline  
Reply With Quote
Old 08-17-2011, 05:56 PM   #2

Tams's Avatar

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

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

Re: SetProfitTarget SetStopLoss

Quote:
Originally Posted by dumpforjunk »
Hi,
How do I set a profit target and stop loss for long, and different target and stop loss for short? Right now, I call setProfitTarget and setStopLoss, and they set a global target and stop loss.

Thanks
starting 2 threads and asking the same question twice is annoying,
it will not get you an answer any faster.
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 08-17-2011, 05:57 PM   #3

Tams's Avatar

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

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

Re: SetProfitTarget SetStopLoss

Quote:
Originally Posted by dumpforjunk »
Hi,
How do I set a profit target and stop loss for long, and different target and stop loss for short? Right now, I call setProfitTarget and setStopLoss, and they set a global target and stop loss.

Thanks
I would suggest you to start with a flowchart...
map out how you want the logic to work,
then code it accordingly.
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 08-17-2011, 07:43 PM   #4

Join Date: Aug 2011
Posts: 3
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts

Re: SetProfitTarget SetStopLoss

I apologize for the double post. I didn't see the first post, so I thought I didn't click the appropriate buttons.

I know the logic that I want to implement. I don't know enough abut EasyLanguage to make the right function calls to set different stops and profit targets.
dumpforjunk is offline  
Reply With Quote
Old 08-17-2011, 08:14 PM   #5

Tams's Avatar

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

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

Re: SetProfitTarget SetStopLoss

Quote:
Originally Posted by dumpforjunk »
I apologize for the double post. I didn't see the first post, so I thought I didn't click the appropriate buttons.

I know the logic that I want to implement. I don't know enough abut EasyLanguage to make the right function calls to set different stops and profit targets.
see post #8
http://www.traderslaboratory.com/for...uage-help.html
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 09-28-2011, 02:09 AM   #6

zapisy's Avatar

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

Thanks: 6
Thanked 26 Times in 17 Posts

Re: SetProfitTarget SetStopLoss

Quote:
Originally Posted by dumpforjunk »
Hi,
How do I set a profit target and stop loss for long, and different target and stop loss for short? Right now, I call setProfitTarget and setStopLoss, and they set a global target and stop loss.

Thanks

More less you can use something like this:

Code:
If marketposition>0 then begin
Setstopcontract;
setprofittarget(100);
setstoploss(100);
end;	

If marketposition<0 then begin
Setstopcontract;
setprofittarget(400);
setstoploss(400);
end;
All the best,

Linetrol Development
zapisy is offline  
Reply With Quote
Old 09-28-2011, 09:14 AM   #7

Tams's Avatar

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

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

Re: SetProfitTarget SetStopLoss

Quote:
Originally Posted by zapisy »
More less you can use something like this:

Code:
If marketposition>0 then begin
Setstopcontract;
setprofittarget(100);
setstoploss(100);
end;	

If marketposition<0 then begin
Setstopcontract;
setprofittarget(400);
setstoploss(400);
end;
All the best,

Linetrol Development
you should not set global exits in conditions.
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 09-28-2011, 01:09 PM   #8

zapisy's Avatar

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

Thanks: 6
Thanked 26 Times in 17 Posts

Re: SetProfitTarget SetStopLoss

to backtest "More less you can use something like this" with intrabarordergeneration
zapisy 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
Different SetStopLoss and SetProfitTarget dumpforjunk Coding Forum 0 08-17-2011 02:53 PM

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