New indicator won't run in custom template

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
tomz
Posts: 7
Joined: Mon Jul 25, 2016 7:00 pm

New indicator won't run in custom template

Post by tomz »

I am working on a custom template and have written a new indicator. The indicator compiles successfully and shows in My Scripts but it won't populate the output of my template. I created two new columns in my template, ran the ATR indicator in both and got output for each one. I then created a new indicator by saving ATR as ATR2 without changing any of the code (ATR2 shows in My Scripts). I put ATR2 in one of the columns. I got output from ATR but not from ATR2.

Is there some method to getting a template to recognize indicators from My Scripts.
Chris White
Posts: 200
Joined: Mon Nov 29, 2010 9:21 pm

Re: New indicator won't run in custom template

Post by Chris White »

Scripts in MyScripts need to be prefixed with "My." and scripts in the System Scans need to be prefixed with "Scan."

So, in your case the correct name would be:
My.ATR2
tomz
Posts: 7
Joined: Mon Jul 25, 2016 7:00 pm

Re: New indicator won't run in custom template

Post by tomz »

The ER editor won't let me use a period in the name. The error msg states that only alphanumerics and underscores are allowed.

I saved ATR2 as My_ATR2 and Scan_ATR2. Neither one puts out any data.
Chris White
Posts: 200
Joined: Mon Nov 29, 2010 9:21 pm

Re: New indicator won't run in custom template

Post by Chris White »

Sorry, I meant that in the Template you should reference the script by using "My.ATR2" instead of "ATR2".

The script name in the script file should not have a "My." in it. The "My." is a namespace applied when the script is compiled and allows you to have identically named scripts in MyScripts as in "SystemIndicators".

So, if you named your copy of ATR with the same name ATR, in your template you could refer to the System Indicators version of ATR using just ATR and your own version using My.ATR

Hope that makes sense.
Chris.
tomz
Posts: 7
Joined: Mon Jul 25, 2016 7:00 pm

Re: New indicator won't run in custom template

Post by tomz »

That worked! Thanks
Post Reply