# Intrabar Median

Questions about MultiCharts and user contributed studies.
wall richard
Posts: 60
Joined: 28 Dec 2007
Has thanked: 9 times
Been thanked: 1 time

### Intrabar Median

I am searching for a study that calculates the median intrabar price. Any help appreciated. I suspect it will involve the opening tick and close with closing tick for a given bar interval.

Stork

TJ
Posts: 7097
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 986 times
Been thanked: 2029 times
if you can come up with the logic or formula, it can be programmed.

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times
If you want the median(middle) price you would do something like-
((H-L)/2) + L

RobotMan
Posts: 375
Joined: 12 Jul 2006
Location: Los Altos, California, USA
Has thanked: 31 times
Been thanked: 12 times
Contact:
// MedianPrice is an EL reserved word.
// If Median Price is calculated on every bar and median price is (H+L)/2 then:

Value1 = MedianPrice ;
Plot1(Value1,"MedianPrice") ;

Bob Perry
Los Altos, CA
Attachments
MedianPrice p196.jpg (23.39 KiB) Viewed 355 times

TJ
Posts: 7097
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 986 times
Been thanked: 2029 times
medianprice is supported by MC.

It is in the PowerEditor's hint, but not in the dictionary.

It is also not in the PowerLanguage chm file.

wall richard
Posts: 60
Joined: 28 Dec 2007
Has thanked: 9 times
Been thanked: 1 time
The original query was for INTRABAR median price. Most replies are for bar median price.

Basically, each individual bar, as chosen, contains an opening tick and a closing tick. Between the two there is a median tick. I'm sure there is no MC study or function for an intrabar median. Basically an array will have to be set up to capture the ticks intrabar, count and sort the ticks then calculate a median tick value in real time. TS has intrabrapersist and dynamic arrays. I'm not sure about MC, but I don't think MC has these capabilities. So a loop needs to function intrabar from open tick to close tick and this data must be put into a tick array, counted, sorted and a medianarray calculated.

Certain bar intervals, such as range bars, require dynamic arrays rather than fixed arrays since they have variable tick counts.

Thanks,

Stiork

wall richard
Posts: 60
Joined: 28 Dec 2007
Has thanked: 9 times
Been thanked: 1 time
Please excuse underlining of last post. I thought it was going under INTRABAR.

Stork

RobotMan
Posts: 375
Joined: 12 Jul 2006
Location: Los Altos, California, USA
Has thanked: 31 times
Been thanked: 12 times
Contact:
Yes, well... good luck with that!

Bob Perry
Los Altos, CA

ABC
Posts: 601
Joined: 16 Dec 2006
Has thanked: 118 times
Been thanked: 345 times
Contact:
You can use intrabarpersist and dynamic arrays with Multicharts as well, it's fully supported.

Regards,

ABC

TJ
Posts: 7097
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 986 times
Been thanked: 2029 times
Just to be sure we are on the same wavelength... Median is not the same as Average.

Arithmetic, Statistics: the middle number in a given sequence of numbers:
4 is the median of 1, 3, 4, 8, 9.
5 is the average of the same series.

Non-technical people interchange the application of the two on non-technical situations.

For most intend and purposes, using Average in place of Median do not significantly affect the outcome of an non-critical application, especially when the population is very large and normally distributed.

wall richard
Posts: 60
Joined: 28 Dec 2007
Has thanked: 9 times
Been thanked: 1 time
TJ

Median is correct. Average or mean may come close in a normal distribution. But, in this situation, tick distribution in a bar is far from a normal Gaussian distribution. And, this is a good thing too because the most critical thing in charting is the final "closing position" in the last bar interval.

I'm very happy ABC informs us that dynamic arrays and intrabarpersist are present and functional in MC. Should make programming much easier than doing it piece meal.

Stork