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 #

Exit a Long Position
----- Original Message -----
From: Ed Montero
To: metastock@xxxxxxxxxxxxx
Sent: Thursday, April 20, 2000 7:37 AM
Subject: Code for stops

Is there any way to set a moving trailing stop in a MS System based on my own criteria.

Specifically, on my S&P system, I move a trailing stop if a bar in my trade direction finishes in the upper 25% of the bar (if long) or lower 25% of the bar (if short), I move the trailing stop to a few ticks under/over the bar. I may also move it based on other criteria, such as weakening trend, etc. Can you write code to set a stop, or does it have to be set up using the available MS options only.

Thanks for your help,

Ed Montero
emontero@xxxxxxxxxxxxxx

Re: Code for stops

. To: "MetaStock listserver" <metastock@xxxxxxxxxxxxx>
. Subject: Re: Code for stops
. From: "Glen Wallace" <gcwallace@xxxxxxxx>
. Date: Thu, 20 Apr 2000 10:10:02 -0700
. References: <003601bfaad6$05e8cf50$336c83cc@xxxxxxxx>
. Reply-To: metastock@xxxxxxxxxxxxx
. Sender: owner-metastock@xxxxxxxxxxxxx

Ed:

Yes, you can write code to set a stop, but it's not pretty if you need to refer to the entry price or entry date. You also have the problem that the System Tester can only exit your trade on the open, close, high or low of the particular bar. The System Tester's built-in stops allow you to exit at the stop price, but I don't think these are flexible enough for what you have in mind.

If you explain your exit parameters in more detail, someone here can probably make some suggestions. For what you have described, you could exit a long position with:


Exit a Long Position

ExitPrice:= If(Close >= High-0.25*(High-Low), Low-AFewTicks, PREV);
Low <= ExitPrice

 

Regards

[21707]

 

Source / From: TOP
http://purebytes.com/archives/metastock/

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!