MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Trailing Stop - AdvTrailStop plug-in by Jose Silva

--- In equismetastock@xxxxxxxxxxxxxxx, "erc90" wrote:
> > Does anyone know how to set a protective stop-loss at 7% of equity,
> > i.e., if one's entire account drops by 7% from the initial capital then > sell everything?
> > thanks!

Erc90, it's best to code stops separately and then reference them into TradeSim explorations - this way one can see how
they actually work on charts.

>From :

Trailing Stop - AdvTrailStop plug-in

{ Initial/Trailing Stop Long v2.0

Note: Stop will not "see" entry signals
on neither the exit or the next signal bar.

AdvancedStop.dll must be in the
...\MetaStock\External Function DLLs\ folder.
AdvancedStop.dll by Richard Dale, free from:

©Copyright 2004-2007 Jose Silva.
The grant of this license is for personal use
only - no resale or repackaging allowed.
All code remains the property of Jose Silva. }

{ User inputs }
per1:=Input("Initial Stop buffer %",0,100,7);
per2:=Input("Trailing Stop buffer %",0,100,7);
pr:=Input("Stop reference: [1]Open, [2]High, [3]Low, [4]Close",1,4,4);
stopCh:=Input("Stop resets at: [1]Close, [2]Intraday",1,2,1);
plot:=Input("plot: [1]Stop, [2]Signals, [3]Trade flag",1,3,1);

{ Entry/Exit Long signals reference }
entry:=Cross(C,Mov(C,21,E)); {<- Example}
exit:=0; {<- Optional}

{ Stop price reference }

{ Long Initial/Trailing Stop }
InitLong:=If(StopLong>=L AND stopCh=2 OR exit,
TrailLong:=If(StopLong>=L AND stopCh=2 OR exit,

{ Long trade flag / signals }
entry:=flag AND Alert(flag=0,2);
exit:=flag=0 AND Alert(flag,2);

{ Plot stop on price chart }


Trailing Stop - AdvTrailStop plug-in by Jose Silva

This stop references custom entry signals. These can be hard-coded into the stop indicator or referenced from an external
signals indicator. Exit signals for the stop are optional but strongly recommended.

jose '-)

Source / From: TOP  

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!