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 #

Sell x Days After Entry (Timed Sell) by Roy Larsen

Hi,

does anyone know how to programm selling x days after entry?

Thanks

Mensur

This should do it.
Roy


Buy - Example

F1:=ValueWhen(1,H<Ref(H,-2) AND Ref(H,-1)<Ref(H,-2) AND Ref(H,-3)<Ref(H,-2) AND Ref(H,-4)<Ref(H,-2),Ref(H,-2));
a:=H>=F1;
If(a>0 AND Alert(a=0,2),Max(O,F1),0);

 


Sell x Days After Entry (Timed Sell)

Pd:=Input("Timed exit delay periods",1,99,25);
N:=Fml("Buy - Example")>0; {your entry formula}
Tr:=If(PREV<=0,If(N>0,1,0),
If(BarsSince(PREV<=0)=Pd,-1,PREV));
Tr=-1;

 

Mensur,

...Or you can use INACTIVITY STOP with a large number :
Example: 999 % within 10 days. If you don't encounter un 999 % change of price in 10 days, the trade will be closed.

Pierre Tremblay

Source / From: TOP
metastock[at]metastock[dot]com

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!