Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
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