Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Outsourcing Indicator from script #487304
03/07/23 21:39
03/07/23 21:39
Joined: Feb 2023
Posts: 14
D
DonDiego Offline OP
Newbie
DonDiego  Offline OP
Newbie
D

Joined: Feb 2023
Posts: 14
For training purposes I coded Vitali Aprine's HHS & LLS indicator

Code
//Vitali Aprine HHSLLS Indicator TASC 02/2016

var HHS(int Length)
	{
		vars Highs = series(priceH());
		var HHH = ifelse(Highs[0] > Highs[1], 
                  (Highs[0] - MinVal(Highs,Length)) / (MaxVal(Highs,Length) - MinVal(Highs,Length)),0);
		return EMA(HHH,Length)*100;
	}
	
var LLS(int Length)
	{
		vars Lows = series(priceL());
		var LLL = ifelse(Lows[0] < Lows[1], 
                  (MaxVal(Lows,Length)-Lows[0]) / (MaxVal(Lows,Length) - MinVal(Lows,Length)),0);
		return EMA(LLL,Length)*100;
	}


function run()
{
             ***some code here***

                  plot("HHS",HHS(20),LINE,BLUE);
		  plot("LLS",LLS(20),LINE,RED);
}


My question is, (how) can I "outsource" the indicator code into another file and call later on in a script? Has this to do with a global variable? Where would I need to store that file? In "source"?
The idea would be to build a custom indicator file over time and don't clutter scripts with that code.

Thank you

Re: Outsourcing Indicator from script [Re: DonDiego] #487305
03/07/23 21:50
03/07/23 21:50
Joined: Feb 2017
Posts: 1,809
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,809
Chicago

Re: Outsourcing Indicator from script [Re: DonDiego] #487306
03/07/23 23:00
03/07/23 23:00
Joined: Feb 2023
Posts: 14
D
DonDiego Offline OP
Newbie
DonDiego  Offline OP
Newbie
D

Joined: Feb 2023
Posts: 14
Thanks Andrew, I'll try that out tomorrow.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1