BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Guppy’s MMA applied to RSC
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Guppy’s MMA applied to RSC

 Post Reply Post Reply
Author
Message / View First Unread Post
Owen View Drop Down
Regular
Regular


Joined: 15 Nov 2004
Posts: 97
Post Options Post Options   Quote Owen Quote  Post ReplyReply Direct Link To This Post Topic: Guppy’s MMA applied to RSC
    Posted: 30 May 2005 at 2:40pm
I applied multiple moving averages to the RSC indicator, but it takes a long time to load my script. Is there a better way to write it?
My script:

MA(fml("Relative Strength Comparison"),3,e);
MA(fml("Relative Strength Comparison"),5,e);
MA(fml("Relative Strength Comparison"),8,e);
MA(fml("Relative Strength Comparison"),10,e);
MA(fml("Relative Strength Comparison"),12,e);
MA(fml("Relative Strength Comparison"),15,e);
[color=red]
MA(fml("Relative Strength Comparison"),30,e);
MA(fml("Relative Strength Comparison"),35,e);
MA(fml("Relative Strength Comparison"),40,e);
MA(fml("Relative Strength Comparison"),45,e);
MA(fml("Relative Strength Comparison"),50,e);
MA(fml("Relative Strength Comparison"),60,e)
Back to Top
Peter View Drop Down
BullCharts Staff
BullCharts Staff
Avatar

Joined: 09 Sep 2004
Location: Australia
Posts: 241
Post Options Post Options   Quote Peter Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2005 at 9:59am
Calling one formula from another can sometimes be slow in BullScript. I've made a faster version by copying the main part of the RSC formula, then assigning the result to a temporary variable.

symb := inputsymbol("Compare to", "XAO");
{calc RSC manually}
tmp := C/LoadSymbol(symb,C);

MA(tmp,3,e);
MA(tmp,5,e);
MA(tmp,8,e);
MA(tmp,10,e);
MA(tmp,12,e);
MA(tmp,15,e);

[color=red]
MA(tmp,30,e);
MA(tmp,35,e);
MA(tmp,40,e);
MA(tmp,45,e);
MA(tmp,50,e);
MA(tmp,60,e)
Back to Top
Owen View Drop Down
Regular
Regular


Joined: 15 Nov 2004
Posts: 97
Post Options Post Options   Quote Owen Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2005 at 4:07pm
Wow Peter your script is lightening fast! I'll have to remember this trick. 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz