logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
fredcom_  
#1 Posted : Friday, February 23, 2007 3:40:03 AM(UTC)
fredcom_

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/23/2007(UTC)
Posts: 7
Location: FRANCE

Hi friends,

My problem was to plot, in an intraday chart (or daily chart), indicators with upper periodicities.
I know that there are indicators to plot Close, but I dind't find anything to plot something more complicated like Bollinger Band or other users indicators.

If you have time, have a look at the 4 indicators below.
They give the opportunity to plot Open, High, Low and Close in any Periodicity you want (greater than the periodicity basis, of course).
First, you have to install the Alchan78.dll in your directory :"D:\Program Files\Equis\MetaStock\External Function DLLs" and restart Metastock.

You can choose between Intraday (from 1 to 60 minutes), Daily, Monthly (from 1 to 12) and Yearly.

---------8<-------------------

{_Reduct_O_combo}
{ **>> _fredcom_ <<** 21fev07 }
{necessite Alchan78.dll}
{http://perso.club-internet.fr/jsallin/Alchan78/Alchan78.zip}

periodicity:=Input("0=Minute; 1=Day; 2=Week; 3=Month; 4=Year",0,5,1);
nb:=Input("nb Minutes or Month, if appropriate ",1,60,1);

intervI:=Ceiling((Minute()+Hour()*60)/nb);
intervM:=ceiling(month()/nb);

keep:=If(periodicity=0,intervI<>ref(intervI,-1) OR DayOfMonth()<>Ref(DayOfMonth(),-1),0);
keep:=If(periodicity=1,DayOfMonth()<>Ref(DayOfMonth(),-1),keep);
keep:=If(periodicity=2,DayOfWeek()<Ref(DayOfWeek(),-1),keep);
keep:=if(periodicity=3,intervM<>ref(intervM,-1),keep);
keep:=If(periodicity=4,Year()<>Ref(Year(),-1),keep);
keep2:=Cum(1)>=LastValue(Cum(1)) ;

Vcomp:=ExtFml( "Alchan78.Select",keep , O);
vcomp


---------8<-------------------


{_Reduct_H_combo}
{ **>> _fredcom_ <<** 21fev07}
{necessite Alchan78.dll}
{http://perso.club-internet.fr/jsallin/Alchan78/Alchan78.zip}

periodicity:=Input("0=Minute; 1=Day; 2=Week; 3=Month; 4=Year",0,5,1);
nb:=Input("nb Minutes or Month, if appropriate ",1,600,1);

intervI:=Ceiling((Minute()+Hour()*60)/nb);
intervM:=Ceiling(Month()/nb);

keep:=If(periodicity=0,intervI<>Ref(intervI,-1) OR DayOfMonth()<>Ref(DayOfMonth(),-1),0);
keep:=If(periodicity=1,DayOfMonth()<>Ref(DayOfMonth(),-1),keep);
keep:=If(periodicity=2,DayOfWeek()<Ref(DayOfWeek(),-1),keep);
keep:=If(periodicity=3,intervM<>Ref(intervM,-1),keep);
keep:=If(periodicity=4,Year()<>Ref(Year(),-1),keep);
keep2:=Cum(1)>=LastValue(Cum(1)) ;

Vcomp:=ExtFml( "Alchan78.Select",keep , Ref(HighestSince(1,keep,H),-1));
vcomp:=Ref(vcomp,1);
vcomp:=ExtFml( "Alchan78.Select",1 , If(keep2,0,vcomp));
vcomp:=If(keep2,vcomp+HighestSince(1,keep,H),vcomp);
vcomp

---------8<-------------------


{_Reduct_L_combo}
{ **>> _fredcom_ <<** 21fev07}
{necessite Alchan78.dll}
{http://perso.club-internet.fr/jsallin/Alchan78/Alchan78.zip}

periodicity:=Input("0=Minute; 1=Day; 2=Week; 3=Month; 4=Year",0,5,1);
nb:=Input("nb Minutes or Month, if appropriate ",1,600,1);

intervI:=Ceiling((Minute()+Hour()*60)/nb);
intervM:=Ceiling(Month()/nb);

keep:=If(periodicity=0,intervI<>Ref(intervI,-1) OR DayOfMonth()<>Ref(DayOfMonth(),-1),0);
keep:=If(periodicity=1,DayOfMonth()<>Ref(DayOfMonth(),-1),keep);
keep:=If(periodicity=2,DayOfWeek()<Ref(DayOfWeek(),-1),keep);
keep:=If(periodicity=3,intervM<>Ref(intervM,-1),keep);
keep:=If(periodicity=4,Year()<>Ref(Year(),-1),keep);
keep2:=Cum(1)>=LastValue(Cum(1)) ;

Vcomp:=ExtFml( "Alchan78.Select",keep , Ref(LowestSince(1,keep,L),-1));
vcomp:=Ref(vcomp,1);
vcomp:=ExtFml( "Alchan78.Select",1 , If(keep2,0,vcomp));
vcomp:=If(keep2,vcomp+LowestSince(1,keep,L),vcomp);
vcomp


---------8<-------------------


{_Reduct_C_combo}
{ **>> _fredcom_ <<** 21fev07}
{necessite Alchan78.dll}
{http://perso.club-internet.fr/jsallin/Alchan78/Alchan78.zip}

periodicity:=Input("0=Minute; 1=Day; 2=Week; 3=Month; 4=Year",0,5,1);
nb:=Input("nb Minutes or Month, if appropriate ",1,600,1);

intervI:=Ceiling((Minute()+Hour()*60)/nb);
intervM:=ceiling(month()/nb);

keep:=If(periodicity=0,intervI<>ref(intervI,-1) OR DayOfMonth()<>Ref(DayOfMonth(),-1),0);
keep:=If(periodicity=1,DayOfMonth()<>Ref(DayOfMonth(),-1),keep);
keep:=If(periodicity=2,DayOfWeek()<Ref(DayOfWeek(),-1),keep);
keep:=if(periodicity=3,intervM<>ref(intervM,-1),keep);
keep:=If(periodicity=4,Year()<>Ref(Year(),-1),keep);
keep2:=Cum(1)>=LastValue(Cum(1)) ;

Vcomp:=ExtFml( "Alchan78.Select",keep , Ref(C,-1));
vcomp:=Ref(vcomp,1);
vcomp:=ExtFml( "Alchan78.Select",1 , If(keep2,0,vcomp));
vcomp:=If(keep2,vcomp+C,vcomp);
vcomp

---------8<-------------------

For example, if I want to plot, on a 1minute basis, the 60minutes Close with the 20 periods moving average and the Bollinger bands (20 periods,2 deviations), I create the dediate indicators :
{_Reduct_C60}
{ **>> _fredcom_ <<** 21fev07}
{necessite Alchan78.dll}
{http://perso.club-internet.fr/jsallin/Alchan78/Alchan78.zip}

nb:=60;

intervI:=Ceiling((Minute()+Hour()*60)/nb);

keep:=intervI<>Ref(intervI,-1) OR DayOfMonth()<>Ref(DayOfMonth(),-1);
keep2:=Cum(1)>=LastValue(Cum(1)) ;

Vcomp:=ExtFml( "Alchan78.Select",keep , Ref(C,-1));
vcomp:=Ref(vcomp,1);
vcomp:=ExtFml( "Alchan78.Select",1 , If(keep2,0,vcomp));
vcomp:=If(keep2,vcomp+C,vcomp);
C60:=vcomp;
C60;
Mov(C60,20,S);
BBandTop(C60, 20,S, 2) ;
BBandBot(C60, 20,S, 2) ;

On the next photo, you could see on the left a chart in a 60minutes basis with, on the upper window the close & mov(c,20,s) & Bollband(c,20,2).
On the right, the chart in a 1 minute basis with on the upper window the C60 Close & mov(C60,20,s) & BollBand(C60,20,s).

UserPostedImage

Of course, it's usable in the Explorer.

Jose  
#2 Posted : Friday, February 23, 2007 8:48:10 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
Fred, the main problem with this external function is that it *compresses* the higher periodicity into the existing data set, rather than *extending* the higher timeframe into the existing data. e.g., observe this plot:: ExtFml( "Alchan78.Condense", C, W); Since the compressed data doesn't match the current data dates, there is a total disconnect between the two plots and thus the external function is useless for comparing higher timeframes to the current one. There is little or no difference between this form of data compression and MetaStock's own data compression, so there is no advantage to be found in using this external function for this purpose. A minor problem with the daily/weekly/monthly indicator signals is that they won't work properly with incomplete charts - i.e., with missing data. You'll find lots of higher timeframe indicators at Roy's site. http://www.metastocktips.co.nz/other_formulas.html jose '-)
fredcom_  
#3 Posted : Friday, February 23, 2007 9:16:02 AM(UTC)
fredcom_

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/23/2007(UTC)
Posts: 7
Location: FRANCE

Hi jose,

Yes, datas on upper periodicities are compressed.

But, if you need now (in real time) the exact value of any indicator, to use it as a filter in the lowest Time unity, it's a way to do it.--> No matter if datas are compressed because it's only the last value that can be use in an Exploration or an Expert.

With timeframe indicators at Roy's site, indicators are "limited" to Weekly and Daily. And it's hard to implement every indicators.

You said : "A minor problem with the daily/weekly/monthly indicator signals is that they won't work properly with incomplete charts - i.e., with missing data. ". --> Try to use my indicator on an intraday timeframe with missing days, and ask it for, say, daily or weekly timeframe. You'll probably have (it works with me) the exact save values as if you ask the same indicator but in daily or Weekly time frame chart.

I agree that my indicators are not for visual approach but for numeric approach. So it can be complementary to Roy's indicators.

Perhaps I'm wrong, but it's useful for me.

Spaceant  
#4 Posted : Friday, February 23, 2007 10:02:22 AM(UTC)
Spaceant

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 8/16/2005(UTC)
Posts: 182

Hi Fred,

This is an interesting Fred. I notice that there are other usages of the DLL. Nevertheless, the manual is written in French. Is there an English translation?

Sa

fredcom_  
#5 Posted : Friday, February 23, 2007 10:39:54 AM(UTC)
fredcom_

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/23/2007(UTC)
Posts: 7
Location: FRANCE

Spaceant wrote:

Hi Fred,

This is an interesting Fred. I notice that there are other usages of the DLL. Nevertheless, the manual is written in French. Is there an English translation?

Sa

At my knowledge, there is no english version of the user manual.

I'm going to try my best to make a traduction.

But, be indulgent, beacause I didn't speak english fluently (as you can read in my messages)[;)]

gabibbo  
#6 Posted : Wednesday, February 28, 2007 10:26:48 AM(UTC)
gabibbo

Rank: Member

Groups: Registered, Registered Users
Joined: 1/4/2006(UTC)
Posts: 21

Thanks: 1 times

Thanks for posting this, Fred.

I've not yet given a try to it but to me it seems as it could be a very very juicy piece of tool... a mousse de chocolat!?!

Hoping to have found a valid alternative to TMW*** dll I'd like to ask you just a question: I've read that among the setting figures you've mentioned a period between 1 and 60 minutes... is this a rigid limit or is it possible to go round it with some tricky string? I ask this 'cos I need to visualize some 4H indicators in 15/60min charts... actually they are just higher-TF entry/stop price levels and some expert trend ribbon/symbols.

Anyway this is a great work and I thank you again for posting.

gabibbo

ps: yes a translation in English should be of the great help... I'm thinking of using babel(altavista) translator for now... I've seen it shows even the French-Italian option, that's great!

*** this one should be still uploaded in the beta section IMHO... I've had great problems with it (never got it working)

fredcom_  
#7 Posted : Monday, March 5, 2007 4:23:28 AM(UTC)
fredcom_

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/23/2007(UTC)
Posts: 7
Location: FRANCE

gabibbo wrote:

...

Hoping to have found a valid alternative to TMW*** dll I'd like to ask you just a question: I've read that among the setting figures you've mentioned a period between 1 and 60 minutes... is this a rigid limit or is it possible to go round it with some tricky string? I ask this 'cos I need to visualize some 4H indicators in 15/60min charts... actually they are just higher-TF entry/stop price levels and some expert trend ribbon/symbols.

...

Hi,

thanks for your message and for the "mousse de chocolat"[;)]

I didn't try timeframe greater than 60 minutes because my Metastock (Pro V8.0) cannot display timeframe greater than this 60 minutes. So I cannot check if the indicator with a 240 minutes input has the exactly same values as a real 240minutes...

But, you can try and you just have to enter 240 for the "nb" value in the indicator.

Good trades.

fredcom_  
#8 Posted : Monday, March 5, 2007 4:29:04 AM(UTC)
fredcom_

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/23/2007(UTC)
Posts: 7
Location: FRANCE

Hi,

you can find a translation in english of the french user manual at :

http://membres.lycos.fr/hostfiles/DLL_Alchan78_english.doc or http://hostfiles.site.voila.fr/DLL_Alchan78_english.doc

Great thanks to Lance and Michel (a canadian trader) who made the translation.

Hope this can help the Metastock community.[:P]

fredcom_  
#9 Posted : Monday, March 5, 2007 5:10:16 AM(UTC)
fredcom_

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/23/2007(UTC)
Posts: 7
Location: FRANCE

Another way to use Alchan78.dll

Say you want to have the exact value of a Weekly Parabolic SAR (not only the SAR on the Close , but with High and Low) on a daily chart.It's easy. Just open 2 windows of the same stock, one in Weekly , one in Daily.On the Weekly chart, insert this indicator:

{W_SAR_out}

{fredcom/01-09-2005}

Wz:=ExtFml("Alchan78.WriteData","C:\ emp\\W_Sar.out",SAR(0.02,0.2));

Wz

and then, on the Daily chart, insert this indicator :

{W_SAR_in}

Ylu:=0;

{fredcom/01-09-2005}

z:=LastValue(Cum(1));

wres:= ExtFml( "Alchan78.ReadData", "C:\ emp\\W_SAR.out") ;

wrez:=If(wres<>0,wres,PREV);

wrez

The result is (left Weekly chart, right Daily chart):
UserPostedImage

If the two charts are in the same Layout, it's possible to switch with any stocks in the directory and have instantatly the Weekly Parabolic SAR on the Daily Chart.

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.