Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 08/30/26 14:27
ZorroGPT
by TipmyPip. 08/29/26 06:56
Retrieve optimize() variables order (edited)
by NorbertSz. 08/25/26 13:24
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (ukgamer, Quad), 3,212 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19230 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,830
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

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