MetaStock™ Zone Tworzenie Sytemów Trader Shop 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 #

System Trade Signals by Jose Silva
Converts entry & exit system logic into distinct trade signals - multiple output choice.

System Trade Signals

{ System trade signals }
{ (c)Copyright 2005 Jose Silva }
{ For personal use only }
{ http://www.metastocktools.com }

{ Note on simultaneous entry/exit on same bar:
#1 Ignore:
entry/exit signals cancel each other;
#2 Preference given to:
new entry if currently Short,
new exit if currently Long.}

{ Signals reference example }
entry:=C>Mov(C,21,E);
exit:=C<Mov(C,10,E);

{ User inputs }
plot:=Input("Signals: [1]Clean, [2]All, [3]Trade binary",1,3,1);
choose:=Input("Simultaneous entry/exit: [1]Ignore, [2]Preference",1,2,1);
delay:=Input("Entry and Exit delay",-1,5,0);

{ Initialize plot }
Init:=Cum(IsDefined(entry+exit))=1;

{ #1 - Ignore entry/exit on same bar }
x:=ValueWhen(1,entry-exit<>0,entry-exit);
long:=x=1 AND (Alert(x<>1,2) OR Init);
short:=x=-1 AND (Alert(x<>-1,2) OR Init);
signals1:=long-short;
binary1:=ValueWhen(1,signals1<>0,signals1);

{ #2 - Preference to first entry/exit }
long:=entry AND (Alert(entry=0,2) OR Init);
short:=exit AND (Alert(exit=0,2) OR Init);
binary2:=ValueWhen(1,long-short<>0,long-short);
long:=binary2=1 AND (Alert(binary2<1,2) OR Init);
short:=binary2=-1 AND (Alert(binary2>-1,2) OR Init);
signals2:=long-short;

{ Select #1 or #2 }
binary:=If(choose=1,binary1,binary2);
signals:=If(choose=1,signals1,signals2);

{ Plot in own window }
Ref(If(plot=2,entry,0),-delay);
Ref(If(plot=1,signals,
If(plot=2,-exit,binary)),-delay)

 

System Trade Signals by Jose Silva

 


System Trade Signals - Original

{ Original trade signals code }
{ BarsSince() function prevents first exit plot}
{ With thanks to Roy Larsen at
http://www.metastocktips.co.nz }

{ Signals reference example }
entry:=C>Mov(C,21,E);
exit:=C<Mov(C,10,E);

{ User inputs }
plot:=Input("Signals: [1]Clean, [2]All, [3]Trade binary",1,3,1);
delay:=Input("Entry and Exit delay",-1,5,0);

{ Clean signals }
Init:=Cum(entry+exit>-1)=1;
entryInit:=Cum(entry)=1;
flag:=BarsSince(Init OR entry)
<BarsSince(Init OR exit)+entryInit;
signals:=(entryInit AND Alert(entryInit=0,2)
OR flag AND Alert(flag=0,2))
-(flag=0 AND Alert(flag,2));
binary:=ValueWhen(1,signals<>0,signals);

{ Plot in own window }
Ref(If(plot=1,signals,
If(plot=2,entry-exit,binary)),-delay)

 

System Trade Signals by Jose Silva
Source / From: TOP
http://www.metastocktools.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!