Shaven Top and Bottom

#1
Hi,

Can anybody plz help me with metastock formula for shaven top and bottom:

Shaven Top:

1) C>O
2) Close should be in top 5% of trading range (H-L).

Shaven Bottom

1)C<O
2) Close should be in bottom 5% of trading range (H-L).

Help appreciated.

Regards,
S
 
Last edited:
#2
Hi Sherbaaz,

Hi,

Can anybody plz help me with metastock formula for shaven top and bottom:

Shaven Top:

1) C>O
2) Close should be in top 5% of trading range (H-L).

Shaven Bottom

1)C<O
2) Close should be in bottom 5% of trading range (H-L).


Help appreciated.

Regards,
S
C>O AND C>L+((H-L)*.95)
OR
C>O AND C>H-((H-L)*.05)


C<O AND C<H-((H-L)*.95)
OR
C<O AND C<L+((H-L)*.05)


please follow color code for the required formula.

hope this helps

Regards

Purush
 

umeshmandal

Well-Known Member
#3
Hi Purush, saw that you are helping people in Coding Metastock indicators etc. So nice of you.
I too have a query : In Metastock, I wish to find out the Range of First bar over a period of say 25 trading sessions. Market starts at 9:15, the move it makes say till 9:20. In short H-L of the first 5 minute or 15 minute or 30 minute candle over a desired period of days. I would then like to know the average of this RANGE over a period. Can it be coded? Please give me a hint only and not a complete solution. Wish to give it a try before asking you to do it for me.
 
#4
Hi Umeshmandal,

Hi Purush, saw that you are helping people in Coding Metastock indicators etc. So nice of you.
I too have a query : In Metastock, I wish to find out the Range of First bar over a period of say 25 trading sessions. Market starts at 9:15, the move it makes say till 9:20. In short H-L of the first 5 minute or 15 minute or 30 minute candle over a desired period of days. I would then like to know the average of this RANGE over a period. Can it be coded? Please give me a hint only and not a complete solution. Wish to give it a try before asking you to do it for me.
thanks. i think you can play with the date logic.

try 'date()<>Ref(date(),-1)' and then you may need to use 'valuewhen' function

first make an indicator with date not matching. then once you plot that indicator, you will get 1s and 0s in indicator.

then try calling only (h-l)s of 1s with 'valuewhen' function.

long back i did this indicator. not able to recollect.

anyhow it might not be a big deal. you try it as said. if you don't get, then i'll see what best i can do.

regards

purush
 

umeshmandal

Well-Known Member
#5
Hi Umeshmandal,



thanks. i think you can play with the date logic.

try 'date()<>Ref(date(),-1)' and then you may need to use 'valuewhen' function

first make an indicator with date not matching. then once you plot that indicator, you will get 1s and 0s in indicator.

then try calling only (h-l)s of 1s with 'valuewhen' function.

long back i did this indicator. not able to recollect.

anyhow it might not be a big deal. you try it as said. if you don't get, then i'll see what best i can do.

regards

purush
Sorry, could not explain properly what I wanted. When I said 1st Bar, I meant first bar in an intraday chart. If its 5 min chart then I need the value of every 9:20 bar's H-L and then the average of these bars.
I think you have tried to explain for EOD charts? !!:eek:
 
#6
hi umeshmandal,

Sorry, could not explain properly what I wanted. When I said 1st Bar, I meant first bar in an intraday chart. If its 5 min chart then I need the value of every 9:20 bar's H-L and then the average of these bars.
I think you have tried to explain for EOD charts? !!:eek:
you had explained it right and i understood it right.

i wanted you to build these indicators on intraday charts only. the date of the first bar of the day doesn't match with previous day's date. thus you can catch first bar (h-l).

hope you can follow the rest from my previous post.

regards

purush
 
#8
hi umeshmandal,

okay, understood better now. Shall give it a try. Thanx.
any progress from your side?

please keep it simple. though sometimes the formulae look longer, they are light on the program and system resources. besides this they remove syntax and programming fears in newcomers' mind.

i made it for you in the same crude way (in the eyes of veterans who have been using metastock for decades). if you want, will post it.
earlier i made it the veteran style only. but this time i made it longer, but lighter to the programmer to learn, understand and progress further.

if you say you will give it a try, i'm very happy.
but please don't hesitate to ask for help.

regards

purush
 

umeshmandal

Well-Known Member
#9
hi umeshmandal,



any progress from your side?

please keep it simple. though sometimes the formulae look longer, they are light on the program and system resources. besides this they remove syntax and programming fears in newcomers' mind.

i made it for you in the same crude way (in the eyes of veterans who have been using metastock for decades). if you want, will post it.
earlier i made it the veteran style only. but this time i made it longer, but lighter to the programmer to learn, understand and progress further.

if you say you will give it a try, i'm very happy.
but please don't hesitate to ask for help.

regards

purush
No Sir, Could not move ahead. Actually could not devote much time too. Though I was explained when I learned the basics how to keep it 'light' etc. but somehow with passage of time forgot about them all. Went through the PDF on Metastock Formula manual but still struggling. Just give me this weekend, thereafter I myself will ask you to Post it.
 

umeshmandal

Well-Known Member
#10
Purush, With active assistance of rkkarnani, I could plot the Opening Bar range on Intraday chart. This is what was my Formula :

{H & L or H-L (range) for first bar of day}
D:=DayOfMonth();
D:=D<>ValueWhen(2,1,D);
H1:=ValueWhen(1,D,H);
L1:=ValueWhen(1,D,L);
H1-L1


Further sir,
When I plot on this Line the MA (of 14 periods of this line, I am getting the average of all values and not the 9:20 bar's average value. How to get that?
I wish to plot the MA of previous 14 candles of 9:20 AM?
 

Similar threads