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_ATR

ATR was developed by J. Welles Wilder and introduced in his book, “New concepts in technical trading systems” (1978). The Average True Range (ATR) indicator measures a security's volatility.

The basic ATR trailing stop trading method formula will switch from support to resistance and visa-versa when breaking support or resistance. For the ATR trailing stop method we calculate the maximum allowed loss based on the basic ATR function multiplied by a factor.

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

 

It is clear that the trailing stop based on ATR is a dynamic stop related to the higher or lower volatility in price action.

You can make the ATR trailing stop more or less sensitive by using different multiplication factors. Apply the ATR trailing stop at past data to find the best fitting value and apply this value for future data.

 

This is the basic formula switching on stop breaks:

SVE_Stop_Trail_ATR

atrper:=Input("ATR period :",1,100,5);
atrfact:=Input("ATR multiplication :",1,10,3.5);
loss:=atrfact*ATR(atrper);
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"
Trailing atr stop chart

 

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 an ATR trailing stop long position from a starting date. Please make sure that the date you select is an existing date in the data series.

SVE_StopLong_Trail_ATR_Date

{SVE_StopLong_Trail_ATR_Date - ATR trailing stop Long from date}
InpMonth:=Input("Month",1,12,1);
InpDay:=Input("Day",1,31,2);
InpYear:=Input("Year",1800,2050,2009);
InitStop:=Input("Initial Stop Price",0.1,10000,10);
atrper:=Input("ATR period :",1,100,5);
atrfact:=Input("ATR multiplication :",1,10,3.5);
loss:=atrfact*ATR(atrper);
EntryLong:= InpYear=Year() AND InpMonth=Month() AND InpDay=DayOfMonth();
EntryLock:=If(Ref(EntryLong,-1)=0 AND EntryLong=1,1,PREV);
support:=C-loss;
TrailStopLong:= If(EntryLock=0 OR EntryLong=1,InitStop,
If(support>Ref(Support,-1),Max(support,PREV),PREV));
TrailStopLong

 

Search the Internet

And this is the MetaStock® formula  for an ATR trailing stop short position from a starting date. Please make sure that the date you select is an existing date in the data series.

SVE_StopShort_Trail_ATR_Date

{SVE_StopShort_Trail_ATR_Date - ATR trailing stop Short from date}
InpMonth:=Input("Month",1,12,1);
InpDay:=Input("Day",1,31,2);
InpYear:=Input("Year",1800,2050,2009);
InitStop:=Input("Initial Stop Price",0.1,10000,10);
atrper:=Input("ATR period :",1,100,5);
atrfact:=Input("ATR multiplication :",1,10,3.5);
loss:=atrfact*ATR(atrper);
EntryLong:= InpYear=Year() AND InpMonth=Month() AND InpDay=DayOfMonth();
EntryLock:=If(Ref(EntryLong,-1)=0 AND EntryLong=1,1,PREV);
support:=C+loss;
TrailStopShort:= If(EntryLock=0 OR EntryLong=1,InitStop,
If(support>Ref(Support,-1),Min(support,PREV),PREV));
TrailStopShort

 

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.
-->