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

Notification

Icon
Error

Options
Go to last post Go to first unread
mchibly  
#1 Posted : Wednesday, May 15, 2013 12:04:47 PM(UTC)
mchibly

Rank: Newbie

Groups: Registered, Registered Users
Joined: 5/15/2013(UTC)
Posts: 2

Hi Everybody,

I'm trying create a formula, but i need these functions, with fixed prices of the day.

Example:

Looking intraday values...

I would like get the first opened value of the day and fixed it.. ( first candle of the day )

Also, for the Highest price of the day and Lowest price of the day..

Anybody know how can i do it ?


henry1224  
#2 Posted : Wednesday, May 15, 2013 1:40:40 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
I could just wish that I would know the highest price and lowest price of the day in advance!

What time frame are you looking at?
as far as the first candle goes, it depends on which time frame you are charting, you need to use the day ,date, and time functions as well as the valuewhen function.
mchibly  
#3 Posted : Wednesday, May 15, 2013 2:41:07 PM(UTC)
mchibly

Rank: Newbie

Groups: Registered, Registered Users
Joined: 5/15/2013(UTC)
Posts: 2

Hi Henry1224,

I'm checking intraday 5 minutes..

I would like compare (plot in a window ) opened price of the day ( first candle of day ) and highest and lowest of the day..

I believe the highest and lowest is easier than opened price of the day.

If you know, could you show me an example ?!


mstt  
#4 Posted : Wednesday, May 15, 2013 9:20:18 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)

Hi mc

Here are a couple of formulas that might help you. The first is "Multi-Frame ID OHLC", and it's main function is to plot O, H, L & C on the current chart for a higher timeframe. The best way to learn how to use this is to load it into MetaStock and experiment with all the options. In "Dynamic" mode any still-developing prices for the last frame will plot on the last bar. "Static" mode plots new frame prices on the last bar of a completed frame (not possible in all situations), and in "Delayed" mode all results are delayed by one bar. That means that the first bar of a new frame must be present before the prices of the just-completed frame can be plotted.

The second formula is based on the first but it has been modified to plot last-bar values of the current (developing) frame for the last 5 frames. With the timeframe set to 1440 minutes you will be able to read off the OPEN, HIGH, LOW and CLOSE for the current day as each new bar develops for whatever periodicity your chart is set to.

You will need the 188KB Forum DLL installed in MetaStock before loading either formula into the Indicator Builder. If you already hae this formula under another name, such as ForumDll_200.DLL, you should make a copy of it and name the copy Forum.DLL. A restart of MetaStock will be necessary if the DLL or the name of the copy is new to the "External Function Dlls" folder. The DLL is available in the Files section of this forum.

Roy

Code:


 {Multi-Frame ID OHLC}
 {Requires Equis Forum DLL}
 {Roy Larsen, 2008-2013, 16/5/13}

 {User settings}
N:=Input("Multi-Frame ID OHLC, Half Frame Offset",0,1,0);
J:=Input("Periodicity in Minutes, 1-1440",1,1440,30);
N:=N*J*(Mod(J,2)=0)/2;
Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,0);

 {Timing signals}
 {Day counter by metastocktools.com}
J:=If((Mod(J,5)=0)*(J<21)+(J=30)+(J<5)+(Mod(J,60)=0)*
((J<241)+(J=480)+((Mod(J,360)=0)*(J<>1080))),J,30);
D:=DayOfMonth();F:=Rnd(Life(291231));
Z:=Cum(1);D:=ValueWhen(1,Z=1,F+D)-F;
D:=D*1440+Minute()+Hour()*60;
I:=Int(If(J=1440,D,D-1)/J);
I:=I>ValueWhen(2,1,I);
G:=LastValue(Lowest(Sum(I>0,9))>7);
I:=ExtFml("Forum.Sum",I,1);M:=(G+I)*(Z>1);
F:=ExtFml("Forum.Sum",Ref(I,1),1)*(M=0)*(Z>1)+G;
B:=LastValue(Z);A:=B-1=Z;B:=B=Z;
J:=If(F,1,(Alert(F,2)=0)*M*2*(Z>1));
J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
J:=If(G,1,If(Q=2,M*2,J));

 {Frame prices}
Om:=ValueWhen(1,M+(Z=1),O);
Hm:=HighestSince(1,M+(Z=1),H);
Lm:=LowestSince(1,M+(Z=1),L);
Om:=ValueWhen(1,J,If(J=1,Om,ValueWhen(2-G,1,Om)));
Hm:=ValueWhen(1,J,If(J=1,Hm,ValueWhen(2-G,1,Hm)));
Lm:=ValueWhen(1,J,If(J=1,Lm,ValueWhen(2-G,1,Lm)));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
Om; Hm; Lm; K;


Code:


{Multi-Frame ID OHLC - Last Value}
{Requires Equis Forum DLL}
{Roy Larsen, 2013, 16/5/13}

{User settings}
N:=Input("Multi-Frame ID OHLC - Last Value",0,0,0);
J:=Input("Periodicity in Minutes, 1-1440",1,1440,240);
Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,1);

{Timing signals}
{Day counter by metastocktools.com}
J:=If((Mod(J,5)=0)*(J<21)+(J=30)+(J<5)+(Mod(J,60)=0)*
((J<241)+(J=480)+((Mod(J,360)=0)*(J<>1080))),J,30);
D:=DayOfMonth();F:=Rnd(Life(291231));
Z:=Cum(1);D:=ValueWhen(1,Z=1,F+D)-F;
D:=D*1440+Minute()+Hour()*60;
I:=Int(If(J=1440,D,D-1)/J);
I:=I>ValueWhen(2,1,I);
G:=LastValue(Lowest(Sum(I>0,9))>7);
I:=ExtFml("Forum.Sum",I,1);M:=(G+I)*(Z>0);
F:=ExtFml("Forum.Sum",Ref(I,1),1)*(M=0)*(Z>1)+G;
B:=LastValue(Z);A:=B-1=Z;B:=B=Z;
J:=If(F,1,(Alert(F,2)=0)*M*2*(Z>1));
J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
J:=If(G,1,If(Q=2,M*2,J));

{Frame prices}
Q:=ValueWhen(1,M+(Z=1),O);
B:=HighestSince(1,M+(Z=1),H);
Y:=LowestSince(1,M+(Z=1),L);
Q:=ValueWhen(1,J,If(J=1,Q,ValueWhen(2-G,1,Q)));
B:=ValueWhen(1,J,If(J=1,B,ValueWhen(2-G,1,B)));
Y:=ValueWhen(1,J,If(J=1,Y,ValueWhen(2-G,1,Y)));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));

{Last frame prices plotted on last 5 frames}
J:=LastValue(Cum(J>0))-5=Cum(J>0);
{Frame OPEN}
ValueWhen(1,J,LastValue(Q));
{Frame HIGH}
ValueWhen(1,J,LastValue(B));
{Frame LOW}
ValueWhen(1,J,LastValue(Y));
{Frame CLOSE}
ValueWhen(1,J,LastValue(K));



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.