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

Reply
Old 01-18-2011, 01:54 PM   #1

Join Date: Jan 2011
Posts: 8
Ignore this user

Thanks: 3
Thanked 0 Times in 0 Posts

Reset EL SetBreakeven

Hi,
I want to set a breakeven stoploss after each new trade has made the appropriate market movement i.e. in the market & 50% towards price target.
If Condition13 = True
and Condition14 =True
Then Begin
SetStopContract;
SetBreakeven(1);
End;End;
However once set for the first trade it stays set for all subsequent trades, is there a way to close it when the trade closes or do I have to go about it a different way?
Lowly 2000i code only and out of ideas.
deadloss is offline  
Reply With Quote
Old 01-19-2011, 07:28 AM   #2

Join Date: Jul 2010
Posts: 60
Ignore this user

Thanks: 13
Thanked 15 Times in 13 Posts

Re: Reset EL SetBreakeven

Hi DeadLoss,

If you want the Setbreakeven to execute only for the first trade, then you could write something like,

Code:
if Totaltrades < 1 then setbreakeven(1);
Else if you are trying to execute the setbreakeven for all trades But only on condition then you can try this..
Code:
if condition99 then setbreakeven(1); //where condition99 is your's
Cheers,
EasyTrader_I.
EasyTrader_I is offline  
Reply With Quote
Old 01-19-2011, 08:51 AM   #3

Join Date: Jan 2011
Posts: 8
Ignore this user

Thanks: 3
Thanked 0 Times in 0 Posts

Re: Reset EL SetBreakeven

Thanks for that but I don't see that anything has changed. I do want a Breakeven stop on every trade but only after the market has moved in the right direction, say 50% towards my target price. The problem with the built in stop is that one it has been set by the first trade reaching the trigger value the breakeven stop stays in force for all subsiquent trades without them triggering the stop. I think I might have to write my own stop but I have writters block so am looking for inspiration, all ideas welcome.
deadloss is offline  
Reply With Quote
Old 01-20-2011, 05:35 PM   #4

Join Date: Feb 2008
Location: charleston
Posts: 63
Ignore this user

Thanks: 7
Thanked 21 Times in 16 Posts

Re: Reset EL SetBreakeven

ifintrade = marketposition <> 0;

if ifintrade and Condition13 and Condition14
Then Begin
SetStopContract;
SetBreakeven(1);
End;End;

but it may have been as simple as resetting conditions

if marketposition = 0 then condition-that-kicks-in-breakeven = false;
statsign is offline  
Reply With Quote
The Following User Says Thank You to statsign For This Useful Post:
deadloss (01-21-2011)
Old 01-20-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,474 Times in 912 Posts

Re: Reset EL SetBreakeven

Quote:
Originally Posted by statsign »
ifintrade = marketposition <> 0;

if ifintrade and Condition13 and Condition14
Then Begin
SetStopContract;
SetBreakeven(1);
End;End;

but it may have been as simple as resetting conditions

if marketposition = 0 then condition-that-kicks-in-breakeven = false;
do not put stoploss/breakeven/profit target in a condition.
it might not execute.
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 01-20-2011, 08:21 PM   #6

Join Date: Feb 2008
Location: charleston
Posts: 63
Ignore this user

Thanks: 7
Thanked 21 Times in 16 Posts

Re: Reset EL SetBreakeven

I've always had in conditions - is that a multicharts thing?
statsign is offline  
Reply With Quote
Old 01-20-2011, 08:28 PM   #7

Tams's Avatar

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

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

Re: Reset EL SetBreakeven

Quote:
Originally Posted by statsign »
I've always had in conditions - is that a multicharts thing?
not just multicharts... tradestation as well.

ppl often get carried away when tweaking their codes,
they adding conditions upon conditions to their strategies as an after thought
and forgotten that IF one of the condition does not meet the criteria,
the stoploss will not be in place anymore.
__________________



Only an idiot would reply to a stupid post
Tams is offline  
Reply With Quote
Old 01-21-2011, 01:59 AM   #8

Join Date: Jul 2010
Posts: 60
Ignore this user

Thanks: 13
Thanked 15 Times in 13 Posts

Re: Reset EL SetBreakeven

Hi Tams,
You may be correct sometimes, But if you expertise in Tradestaion Programming or any with any other platform, then it doesn't effect though..right?

So stoploss/breakeven/profit target will work in a condition only if you code it such a way...

Please correct me if I am wrong..

EasyTrader_I
EasyTrader_I is offline  
Reply With Quote

Reply

Tags
breakeven, easylanguage, stoploss, strategy engine

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
Reset or Clear Each New Bar PeterBrazel Coding Forum 10 10-28-2009 11:19 AM

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