Latest News

2022 Start working on a new website

BBS Trading Expert
Watch the Youtube BBS video and here is a crude oil trading example

 

Want to know more about:

NinjaTrader formulas.

MetaStock formulas.

MetaTrader formulas.

My YouTube videos.

AXIOM business books awards, bronze medal! Thank You!

No longer available!

 

 

Favorite articles in 2010, 11, 12, 14 and 2015 S&C Readers' Choice Awards.

readers choice awards

AXIOM Business Books Awards, bronze medal.

AXIOM award

 

 

 

 


 

MetaStock Formulas

HOME   Back to MetaStock Formulas Overview

SVE_Stop_Trail%

The basic trailing stop trading method formula will switch from support to resistance and visa-versa when breaking support or resistance. For the fixed percentage trailing stop method we calculate the maximum allowed loss based on a fixed percentage of the closing price.

Additionally I am showing you the formula to use a fixed percentage trailing stop from a start date for either a long or a short trade.

 

Because with this trailing stop method we are using a fixed percentage, there is not much we can try for getting a better result.

The only thing you could do is look at the past and see for each individual stock what was the best fitting percentage in a previous period and apply an individual value for each stock. This may get you a better total result. However I would advise not to deviate more than 3% of the common value to avoid too much optimization.

 

This is the formula:

SVE_Stop_Trail%

perc:=Input("Trailing Loss % :",0,100,14);
loss:=C*perc/100;
trail:=
If(C>PREV AND Ref(C,-1)>PREV,
Max(PREV,C-loss),
If(C<PREV AND Ref(C,-1)<PREV,
Min(PREV,C+loss),
If(C>PREV,C-loss,C+loss)));
Trail

 

Special offer: "Capturing Profit with technical Analysis"
 

percentage trailing stop

Using your own trading method finding entry points you most probably would like to have this trailing stop available from your own entry date.

So, this is the MetaStock® formula  for a fixed percentage trailing stop from a starting date.

SVE_Stop_Trail%_Date

InpMonth:=Input("Month",1,12,1);
InpDay:=Input("Day",1,31,1);
InpYear:=Input("Year",1800,2050,2009);
LongShort:=Input("1=Long or 2=Short? ",1,2,1);
InitStop:=Input("Initial Stop Price",0.1,10000,10);
Perc:=Input("Trailing Stop Percentage",1,30,12);
Loss:=C*Perc/100;
Entry:= InpYear=Year() AND InpMonth=Month() AND InpDay=DayOfMonth();
EntryLock:=If(Ref(Entry,-1)=0 AND Entry=1,1,PREV);
support:=If(LongShort=1,C-loss,C+loss);
StopLong:= If(EntryLock=0 OR Entry=1,InitStop,
If(support>Ref(Support,-1),Max(support,PREV),PREV));
StopShort:= If(EntryLock=0 OR Entry=1,InitStop,
If(support>Ref(Support,-1),Min(support,PREV),PREV));
Trail:=If(LongShort=1,Stoplong,Stopshort);
Trail

 

 

Search the Internet

 

HOME   Back to MetaStock Formulas Overview


 
 

Risk Disclosure: Futures and forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones’ financial security or life style. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results.

Hypothetical Performance Disclosure: Hypothetical performance results have many inherent limitations, some of which are described below. no representation is being made that any account will or is likely to achieve profits or losses similar to those shown; in fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. One of the limitations of hypothetical performance results is that they are generally prepared with the benefit of hindsight. In addition, hypothetical trading does not involve financial risk, and no hypothetical trading record can completely account for the impact of financial risk of actual trading. for example, the ability to withstand losses or to adhere to a particular trading program in spite of trading losses are material points which can also adversely affect actual trading results. There are numerous other factors related to the markets in general or to the implementation of any specific trading program which cannot be fully accounted for in the preparation of hypothetical performance results and all which can adversely affect trading results.

See more 'Legal Disclosures' in the bottom menu bar!

Copyright © 2007 Stocata.org, All rights reserved.
-->