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 #

Restricted Display by Preston Umrysh

Hello,

I would like to restrict the plotting of indicators on my charts to the last x number of periods. For example, when plotting weekly pivots on a daily chart, I would like to only plot lines for the current week and not every week back to the beginning of the chart. It would also be nice just to see, say, the end of an MA plot. I am currently using daysofweek but I am sure that it is not the most efficient way of doing it.

Any suggestions for a more elegant solution?

Thanks in advance.

Kevin

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Hi Kevin,

It can be done with this indicator. Should be self explanatory. If you need any help just let me know.

Hope it helps,

Preston


Restricted Display


{Written by Preston Umrysh}
{Correctly Displays an indicator for a specified period of time}

Pds:=Input("Indicator periods ",1,1111,10);
DisPds:=Input("Select Display Periods",1,1111,10);
BackPds:=Input("Select Setback Periods",0,1111,0);

{Indicator}
Ind:=Mov(C,pds,S);{Place your indicator here}

{Restricted Display}
ResPds:= Alert(BarsSince(Cum(1)=LastValue(Cum(1)-(DisPds+BackPds))
=1),1);
Plot:=ValueWhen(1,ResPds,Ref(Ref(Ind,-BackPds),BackPds));
Plot; {end}


Restricted Display
Source / From: TOP
equismetastock[at]yahoogroups[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!