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

Notification

Icon
Error

Options
Go to last post Go to first unread
p_ashvin  
#1 Posted : Tuesday, March 2, 2010 6:05:42 AM(UTC)
p_ashvin

Rank: Newbie

Groups: Registered, Registered Users
Joined: 10/11/2009(UTC)
Posts: 1

hi I have read his codes in easy language, the problem with your code is that

1) in definition of Quadrature variable you used " prev" which means it will take the previous bar value of Quadrature variable. While in ehler's code he defined instaperiod as a variable and assigned a value of 0 to it. then used previous bar's value of instaperiod in code of Quadrature variable.


I will urge metastock coding experts to provide code for the same. in simple terms explained as under.

pr:=0;
pp:=(close+high+low)+ ref(pr,-1); {previous value of pr}

pr:=close+ref(close,-1)+prev; {previous value of pr}

I am in need for this code so please help me out.

Thanks,
Ashvin

{edit: moved from thread - http://forum.equis.com/forums/thread/28003.aspx
wabbit  
#2 Posted : Tuesday, March 2, 2010 8:02:59 AM(UTC)
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)
wabbit  
#3 Posted : Tuesday, March 2, 2010 5:44:31 PM(UTC)
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)
I guess I should have also added:

Before blasting off into the code, if you are going to be putting real money behind these algorithms and trading systems, you had better be very sure you understand exactly how the system works as a whole, and, how each component works within that system. This also goes for code rationalisation and optimisation; ask yourself, "Is there a better way to achieve the aim?"

In a lot of cases involving recursion (but not all cases) the code in MS can be rationalised to remove the slow PREV function:

e.g. compare
Code:

data:=close;
p1:=data+ref(data,-1)+prev;
p2:=2*cum(data)-data-valuewhen(1,cum(1)=1,data);

{plot}
p1;
p2;
However, be aware that accumulating large values over prolonged periods induces errors in MS due to the way it deals with large numbers.


wabbit [:D]


Users browsing this topic
Guest (Hidden)
Similar Topics
Need help with PREV function on Highlight (Formula Assistance)
by Leverage 11/4/2013 6:17:00 PM(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.