Adjust stop loss with setstoploss

Questions about MultiCharts and user contributed studies.
Erik Pepping
Posts: 74
Joined: 25 Aug 2007
Been thanked: 6 times

Adjust stop loss with setstoploss

Postby Erik Pepping » 20 Nov 2011

I have a fixed stoploss in my strategy. I do this with:
SetStoploss(400). However At one point i want to set the system to breakeven + 1 point. This is no longer a stop loss, since it will no be < 0.

How can i set this order at the broker ?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Adjust stop loss with setstoploss

Postby TJ » 20 Nov 2011

I have a fixed stoploss in my strategy. I do this with:
SetStoploss(400). However At one point i want to set the system to breakeven + 1 point. This is no longer a stop loss, since it will no be < 0.

How can i set this order at the broker ?
do you mean a trailing stop?

Erik Pepping
Posts: 74
Joined: 25 Aug 2007
Been thanked: 6 times

Re: Adjust stop loss with setstoploss

Postby Erik Pepping » 20 Nov 2011

No I'm trying to use the setbreakeven command in multicharts 7.2 beta.
But it does not seem to work.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Adjust stop loss with setstoploss

Postby TJ » 20 Nov 2011

No I'm trying to use the setbreakeven command in multicharts 7.2 beta.
But it does not seem to work.
what do you mean by "it does not seem to work"?

if you want specific help, you have to be more detailed.
eg. describe your intention, post your code, post your flowchart,
a diagram or a chart always helps to illustrate your situation.

Erik Pepping
Posts: 74
Joined: 25 Aug 2007
Been thanked: 6 times

Re: Adjust stop loss with setstoploss

Postby Erik Pepping » 21 Nov 2011

My code is:

if marketposition <> 0 then
if openpositionprofit >= (ChandelierStopPercentage / 100) * (MyStopProfit) then
setbreakeven(Mybreakeven);


It does not work. The ChandelierStopPercentage is u number between 1 and 100. Mystopprofit is in Dollars and also a user input variable to the study. On no charts whatever the ChandelierStopPercentage the Setbreakeven is executed

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Adjust stop loss with setstoploss

Postby TJ » 21 Nov 2011

My code is:

if marketposition <> 0 then
if openpositionprofit >= (ChandelierStopPercentage / 100) * (MyStopProfit) then
setbreakeven(Mybreakeven);


It does not work. The ChandelierStopPercentage is u number between 1 and 100. Mystopprofit is in Dollars and also a user input variable to the study. On no charts whatever the ChandelierStopPercentage the Setbreakeven is executed
see post #3
viewtopic.php?f=16&t=6929

Erik Pepping
Posts: 74
Joined: 25 Aug 2007
Been thanked: 6 times

Re: Adjust stop loss with setstoploss

Postby Erik Pepping » 21 Nov 2011

Setbreakeven does not make any sense to do it not conditionally, since it would be set immeadiatly, something you only want conditionally.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Adjust stop loss with setstoploss

Postby TJ » 21 Nov 2011

Setbreakeven does not make any sense to do it not conditionally, since it would be set immeadiatly, something you only want conditionally.
read the manual again, it is a short section, it wouldn't take much trouble.

Erik Pepping
Posts: 74
Joined: 25 Aug 2007
Been thanked: 6 times

Re: Adjust stop loss with setstoploss

Postby Erik Pepping » 21 Nov 2011

Will do, but you know real man don't read manuals :)

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Adjust stop loss with setstoploss

Postby TJ » 21 Nov 2011

Will do, but you know real man don't read manuals :)
real man don't lose money either. ;-)



ps. alternatively you can read what I wrote in the link above. It should be sufficient to tide you over.


Return to “MultiCharts”