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

Notification

Icon
Error

Options
Go to last post Go to first unread
Leverage  
#1 Posted : 14 years ago
Leverage

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 1/25/2010(UTC)
Posts: 44
Location: Rome, IT

Hi guy... I trying to plot the average price about load data. For example something like: ind:=(Highest(C)+Lowest(C))/2; ind but the line plotted for the load data it's not costant, but variable for each bar who form a new relative max. Someone have an idea to obtain a costant value to plot in base of the max and the min for the load data? Thanks
jjstein  
#2 Posted : 14 years ago
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Do you want the "average" price for one bar, or over time?

Metastock Formula Language can be a little confusing, until you recognize that the price variables of H, L, O, C (High, Low, Open, Close) is treated as an "array" -- a collection or group of numbers spread over a time. The time PERIODICITY is specified in the lower-right toolbar: D=Daily, W=Weekly, etc -- each bar can represent a Day, a Week, etc.

In the example you gave, "Highest(C)" would give the largest value for closing price over the entire time period you loaded (something specified in LOAD OPTIONS when using FILE OPEN). It is important to note that this is different vary from the period loaded for Explorations and System Tests -- if they're not the same, the results can be different from what you see on a chart!

For any given bar, you can use these built-in functions (details are in F1 - HELP):

Median Price, or MP(), which is (High + Low)/2
Typical Price, or TYP(), which is (High + Low + Close)/3

Leverage  
#3 Posted : 14 years ago
Leverage

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 1/25/2010(UTC)
Posts: 44
Location: Rome, IT

Thanks JJ my interesting is for over time not one bar. For example if I load 500 bar, I would like to plot the average price through the highest close (or high) of this 500 bars and the lowest close (or low) of this 500 bars. Thus, if I load 1000 bars i would like to plot the average price of this 1000 bars etc...
jjstein  
#4 Posted : 14 years ago
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Try this:

{* Long-Term Average *}
Periods:=Input("Periods",1,10000,500);
(HHV(C,Periods)+LLV(C,Periods))/2


Leverage  
#5 Posted : 14 years ago
Leverage

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 1/25/2010(UTC)
Posts: 44
Location: Rome, IT

Thanks JJ, it's a good point to start....I try to reason from this. thanks again
wabbit  
#6 Posted : 14 years ago
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Do you mean the average of all the prices of the loaded data, or, the midpoint between the highest and lowest data points? They are not the same...

Use LastValue() to make a constant of the data across the entire chart, but be warned the information cannot be used for real life trading without being fully aware of how it works!


wabbit [:D]

Users browsing this topic
Guest (Hidden)
Similar Topics
average price (Formula Assistance)
by wens5168 12 years ago
Looking for % of NYSE Comp stocks above 200 day moving average price line (Data Related Questions)
by Shelby 12 years ago
HELP How to code: "If 5-day average price > 5-day average price from the prior 5-day period" (Formula Assistance)
by meridien 16 years ago
How do I generate a conditional clear signal for an average price? (Formula Assistance)
by BillyB 18 years ago
How do I generate a conditional clear signal for an average price? (MetaStock)
by BillyB 18 years ago
VWAP - Volume Weighted Average Price [RESOLVED] (Formula Assistance)
by axioma 19 years ago
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.

information You have 1 unread message(s) in your Inbox.