PDA

View Full Version : Fixed Trailing Stop loss


Metastockuser
8th August 2003, 12:25 PM
Can anyone tell me how to set up a "fixed percentate trailing stop loss" ? Something like a 10% trailing stop or 8% trailing stop?

I've been able to create an intial stop that works as a protective stop. volatility stops and a standard deviatation stop. But I have no clue how to set up a trailing stop loss of say 10% so that it will work with Metastock-Trade Sim

sectorbets
8th August 2003, 04:19 PM
I have also tried and failed. What I am specifically interested in is a trailing stop that calcualtes maximum profit in the position from inception and then trails a stop let's say 10% below/above that level.

Stevo
8th August 2003, 09:08 PM
This should work;

Fixed:=Input("fixed % stop",1,100,10);
Volatility:=C*fixed/100;
stop:=ExtFml( "TradeSim.TrailingStop",
BAND,
LONG,
Volatility,
CLOSE,
CLOSE);
stop

Stevo
8th August 2003, 09:19 PM
sectorbets - what you are after is a little trickier! I have some code that looks at MFE that might be of value. Email me if you are interested.

Metastockuser
9th August 2003, 01:20 AM
As a non programmer this stuff can be a bit much. The fixed trailing stop loss was the last bit I needed. One of the stocks I optimized works best with a fixed trailing stop but I didn't know how to program that in.

What I do is use the stops in Metastock System tester to very quickly see what type works best then I can dial it in with Trade Sim. But obviously that means the stop has to be programmed into a metastock exploration.

Metastockuser
9th August 2003, 02:17 AM
Well, I guess you gave me exactly what I asked for but I didn't explain very well what I wanted.

I was after a trailing stop that would always be a fixed percentage of the HIGHEST close since my entry trigger. In that way, if the closes start droping off, the fixed stop loss does not.

It appears to me that the formula you gave me will produce a band that will fall away as the close falls away?

Also, something that complicates it is my system can produce more than one entry trigger. Only the first trigger is taken and it's from that point I would start taking the highest close for the fixed stop loss.

unfortuantely I know what I want but don't know how to program it.

Stevo
9th August 2003, 10:31 PM
MSuser
When I plot this stop on a chart it does what you want - assuming I understand what you want. The only time it will go down is when the close is below the stop loss line.

I use a similar stop with TradeSim without problem. I just add in;

ExitTrigger:=C<Ref(stop,-1)

Steve

Metastockuser
10th August 2003, 01:02 PM
I have been able to get something by playing with what you have given me. Rather than define a variable for volatility I just code it in: I haven't checked out how it works line by line yet but just looking at raw numbers it seems to be working.

ExitTrigger1:= (my indicators exit signal;

Volatility:=C*.10;
stop:=ExtFml( "TradeSim.TrailingStop",
BAND,
LONG,
Volatility,
CLOSE,
CLOSE);

ExitTrigger2:= C<Ref(stop,-1);

ExitTrigger:= ExitTrigger1 OR ExitTrigger2;

Jose
3rd January 2004, 11:37 PM
This may be of interest in this topic.
file://localhost/C:/Store/Stockmkt/Pegasus/MetaStock/TrailStop.txt

jose '-)

Jose
3rd January 2004, 11:38 PM
oopsey...
http://users.bigpond.com/prominex/MetaStock/TrailStop.txt
http://users.bigpond.com/prominex/MetaStock/ATRstop.txt

jose '-)