• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 10:51pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 10:51pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Close Price VS Median Price (or other price types) 33 replies

Needed Median, Highest, and Lowest Price Range Indicator 1 reply

Yesterday OHLC and median lines alert. 4 replies

High Low Median Indicator. 2 replies

Need an indicator that calculates the median price 3 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 1
Attachments: Median of a Price Series
Exit Attachments

Median of a Price Series

  • Post #1
  • Quote
  • First Post: Jul 4, 2008 1:50pm Jul 4, 2008 1:50pm
  •  tboyett
  • | Joined Apr 2006 | Status: Member | 13 Posts
Looking for an indicator that calculates the median, NOT AVERAGE, of a price series. The only way I know to get the median is to sort the data and I have not been able to get MT4 to do that. Any help greatly appreciated.

tb
  • Post #2
  • Quote
  • Jul 4, 2008 2:14pm Jul 4, 2008 2:14pm
  •  lucidlamp
  • | Joined May 2007 | Status: I do my best while asleep... | 238 Posts
tboyett,

Place a 'Moving Average' indicator on the chart. When the 'Parameters' window pops-up. Use the 'Apply to' drop-down list to select 'Median price'.

lucidlamp
  • Post #3
  • Quote
  • Jul 4, 2008 2:29pm Jul 4, 2008 2:29pm
  •  tboyett
  • | Joined Apr 2006 | Status: Member | 13 Posts
Lucid -

Even though MT4 calls it median price, it is actually the midpoint price of each bar. That is not what I'm after. I will quote wikipedia's definition of median:

In probability theory and statistics, a median is described as the number separating the higher half of a sample, a population, or a probability distribution, from the lower half. The median of a finite list of numbers can be found by arranging all the observations from lowest value to highest value and picking the middle one.

Thanks,
tb
  • Post #4
  • Quote
  • Jul 4, 2008 9:57pm Jul 4, 2008 9:57pm
  •  lucidlamp
  • | Joined May 2007 | Status: I do my best while asleep... | 238 Posts
tboyett,

So, according to the wikipedia, if a 5 minute bar contains 4 ticks:

1.0000, 1.0002, 1.0002, 1.0006

the median would be 1.0002, as opposed to what I suggested which would be 1.0003 ((H-L)/2)?

lucidlamp
  • Post #5
  • Quote
  • Jul 4, 2008 10:03pm Jul 4, 2008 10:03pm
  •  Kenz987
  • Joined Aug 2006 | Status: Member | 737 Posts
Anyone have an incore sort?
  • Post #6
  • Quote
  • Jul 5, 2008 8:37am Jul 5, 2008 8:37am
  •  DaveL
  • | Joined Aug 2006 | Status: Member | 142 Posts
MT4 does not keep tick data, so it's unable to determine the "true" median price of a bar for its calculations.

However, you can straightforwardly set up a tick-collection system and start building your own tick library, which you can use to determine the median price of a bar easily.

To start building a tick library, consider this helpful reference.
Dave
  • Post #7
  • Quote
  • Jul 5, 2008 2:39pm Jul 5, 2008 2:39pm
  •  tboyett
  • | Joined Apr 2006 | Status: Member | 13 Posts
Quote
Disliked
So, according to the wikipedia, if a 5 minute bar contains 4 ticks:

1.0000, 1.0002, 1.0002, 1.0006

the median would be 1.0002, as opposed to what I suggested which would be 1.0003 ((H-L)/2)?

Lucid, exactly right.

tb
  • Post #8
  • Quote
  • Jul 5, 2008 3:27pm Jul 5, 2008 3:27pm
  •  tboyett
  • | Joined Apr 2006 | Status: Member | 13 Posts
Folks,

A generous programmer has provided a nice custom indicator that works perfectly (at least according to my experience) and I am happy to share it with you. Enjoy. And thanks to our programmer.

tb
Attached File
File Type: mq4 Median.mq4   1 KB | 1,045 download
  • Post #9
  • Quote
  • Last Post: Jul 5, 2008 3:48pm Jul 5, 2008 3:48pm
  •  lucidlamp
  • | Joined May 2007 | Status: I do my best while asleep... | 238 Posts
tboyett,

I misinterpreted your request but I am glad you received what you were looking for.

Thanks for the code as well,

lucidlamp
  • Platform Tech
  • /
  • Median of a Price Series
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2021