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

Notification

Icon
Error

Options
Go to last post Go to first unread
gorachand  
#1 Posted : Thursday, December 26, 2013 3:43:51 AM(UTC)
gorachand

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 2/19/2012(UTC)
Posts: 106

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
On many custom Metastock formulas i have seen the following line:-

A:=x+y+z;
{plot}
A;
What exactly do the 3 lines signify?
Though enclosed in curly brackets---I haven't found the variable 'plot' anywhere in the Metastock formula primer.I understand comments in curly brackets are ignored by metastock--if so what is the use of declaring 'A' again on the 3rd line?

Also Ref(C,-1) means the previous closing price, But I have seen formulas having ref(data array,+x) where x is a number. What is the meaning of this forward looking reference?

I would also like to know more about the Cum function---how does it differ from the sum function. how is it written? There is only one line about it in the primer/


Regards,

Dr.Chatterjee

henry1224  
#2 Posted : Thursday, December 26, 2013 6:48:16 AM(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)
A:=X+Y+Z; A becomes a variable that shows the total value of the 3 other variables, depending on what those variables are , it just becomes faster to compute by calling it A in future code.
the curly brackets just make reading the code easier

A data array could be Open ,High, Low, Close, Volume, Variable, P,A formula call

here is a little test, plot this on a chart

Code:
A:=Mov(C,10,S);AR:=Ref(Mov(C,10,S),-10);AF:=Ref(Mov(C,10,S),10);A;AR;AF;
The first line is a simple MAThe second line is the MA referenced back 10 bars
The third line is forward referenced ahead by 10 bars

change the color of each line
now go to the very end of the chart and see the results



The cum function counts the number of times an event has occurred on a chart

The sum function counts the number of times an event has occurred in a specific time period
gorachand  
#3 Posted : Thursday, December 26, 2013 7:26:13 AM(UTC)
gorachand

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 2/19/2012(UTC)
Posts: 106

Thanks: 1 times
Was thanked: 1 time(s) in 1 post(s)
Thank you for your reply. I think I have understood a part of it.

Does the cum function count the no. of times an event has occurred on the chart right from the beginning of my database?Is that what you mean?

The line
AF:=Ref(Mov(C,10,S),10);

Mov av is referenced forward by 10 bars. What exactly does that mean? That data hasn't been downloaded into the computer as yet.

When I plot my mov av indicator in Metastock, there is an option to forward or backward reference it horizontally. I believe this is the same as your line. What foxes me is that there is an option to shift it vertically. I find that stumping. Could you please explain?

Regards,

Dr.Chatterjee

henry1224  
#4 Posted : Thursday, December 26, 2013 8:09:13 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)
Load 2500 bars onto a chart, Now plot Cum(1) on it , the indicator will show 2500 at the very end of the chart.

A forward referenced data array has not occurred as of the last bar on the right edge of the chart.

Elvis has left the building and you are still waiting for the show to start?

To shift a MA vertically, just multiply it by a prcentage
Users browsing this topic
Guest (Hidden)
Similar Topics
X day high price plot and search (Formula Assistance)
by Drummo1111 1/24/2021 4:33:10 AM(UTC)
PLOT YEARLY HIGH LOW (Formula Assistance)
by kkrishna79 7/1/2019 11:01:13 AM(UTC)
Extend Trendline - date range - Extend plot to end of chart (Formula Assistance)
by Derek Worswick 5/24/2017 10:53:18 AM(UTC)
Can plotting be done on any different bar, instead of the latest bar (Basic Coding Techniques)
by vikas 5/10/2017 3:42:08 PM(UTC)
How do I plot an indicator onto a MetaStock chart? (MetaStock RT and DC)
by MS Support 5/5/2017 10:54:39 PM(UTC)
Plots (Formula Assistance)
by sunman4008 4/19/2017 1:59:03 PM(UTC)
Does not plot (Formula Assistance)
by gorachand 2/3/2017 2:54:47 PM(UTC)
Plotting Custom indicators (Advanced Coding Techniques)
by ozboss55 5/18/2016 11:12:41 AM(UTC)
Help to code and plot the high and the low of previous days in an intraday chart (Formula Assistance)
by ItalMeta 3/3/2016 11:40:56 AM(UTC)
Plot on chart without display trading signals (MetaStock)
by turtlet 4/10/2015 6:01:14 AM(UTC)
PLOTING CLOSING ON THE CHART (Formula Assistance)
by kkrishna79 1/7/2015 11:44:06 AM(UTC)
Plot a line (Formula Assistance)
by gorachand 12/28/2014 3:18:11 PM(UTC)
Plotting a Chart (MetaStock)
by landeisb 11/15/2014 9:38:41 PM(UTC)
Plotting a Chart (MetaStock FAQ)
by landeisb 11/15/2014 9:38:41 PM(UTC)
Crossover signals plotting outside the date range (Formula Assistance)
by aksh 8/7/2014 11:14:55 AM(UTC)
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.