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

Notification

Icon
Error

Options
Go to last post Go to first unread
Gregor  
#1 Posted : Friday, October 15, 2010 10:14:01 AM(UTC)
Gregor

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 6/12/2007(UTC)
Posts: 32

I have a indicator that had 23 variables. This meant I fell foul of Metastock's maximum number of variable you are allowed to use rule, which stands at 20. Using large number of variables in a formula helps keeps the code simple and easy to read. Therefore this max20 rule should be change to allow the use of larger number of variables.
mstt  
#2 Posted : Friday, October 15, 2010 1:10:04 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi Gregor MetaStock actually restricts the number of variable names per formula, not the number of variables. What this means is that once you're finished with one name you can re-use that name. Once a variable has fulfilled its purpose and is not required later in the formula its name becomes available for any other use you may have for it. This process can be repeated a number of times when the makeup of the code allows. True, this can make following the code a little more confusing, but who cares if it gets the job done? Another trick that works for me is to modify a variable in order to change its functionality, redefine the variable if you like but retaining its existing name. As an example of that, last night I adapted the Vervoort Inverse Fisher RSI with 19 variable names to fit my Multi-Frame format, a format that requires around another 15 variables. Mission accomplished. By developing the 10 WMA variables and their summed value in stages I was able to reduce 11 variables down to just 2. Part of the original formula looks like this... ma1:= Mov(C,2,W); ma2:= Mov(ma1,2,W); ma3:= Mov(ma2,2,W); ma4:= Mov(ma3,2,W); ma5:= Mov(ma4,2,W); ma6:= Mov(ma5,2,W); ma7:= Mov(ma6,2,W); ma8:= Mov(ma7,2,W); ma9:= Mov(ma8,2,W); ma10:= Mov(ma9,2,W); RainbW:= (5*ma1+4*ma2+3*ma3+2*ma4+ma5+ma6+ma7+ma8+ma9+ma10)/20; and once reduced to just two variable names it looks like this (K being the weekly CLOSE). MA:=Mov(K,2,W); RB:=5*MA; MA:=Mov(MA,2,W); RB:=RB+4*MA; MA:=Mov(MA,2,W); RB:=RB+3*MA; MA:=Mov(MA,2,W); RB:=RB+2*MA; MA:=Mov(MA,2,W); RB:=RB+MA; MA:=Mov(MA,2,W); RB:=RB+MA; MA:=Mov(MA,2,W); RB:=RB+MA; MA:=Mov(MA,2,W); RB:=RB+MA; MA:=Mov(MA,2,W); RB:=RB+MA; MA:=Mov(MA,2,W); RB:=(RB+MA)/20; So it's not a matter of what MetaStock won't allow but rather a matter of working out how to overcome its apparent and often annoying limitations. Roy
Users browsing this topic
Guest (Hidden)
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.