Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
MACD / Stoch useage #482562
02/25/21 21:22
02/25/21 21:22
Joined: Jan 2021
Posts: 18
London
T
TraderTom Offline OP
Newbie
TraderTom  Offline OP
Newbie
T

Joined: Jan 2021
Posts: 18
London
Hi guys. Have a feeling this will be a fairly simple answer but I'm trying to understand how the indicators with multiple outputs are handles in zorro? In metatrader for example you slected the outputs with buffers and associated numbers.

I know the example code is incorrect but posting it as an example. Say I'm trying to get the MACD histogram output where MACD is in the string of outputs. Or the Stochastic K line for example.

Code
 
function run()
{
	StartDate = 20190101; // start two years ago
	BarPeriod = 15; // minutes per bar bars
	LookBack = 100; // needed for scale()
	var PredictHorizon = -3;

	set(RULES);   // generate signals
	LifeTime = 3; // prediction horizon
	Spread = RollLong = RollShort = Commission = Slippage = 0;
	
	adviseLong(SIGNALS+BALANCED+PEEK,0,
		MidPrice(0),MidPrice(3),priceOpen(0),priceOpen(-3),MACD(priceClose,12,26,9));
	enterLong(); 
}


I know this is probably a very simplistic question but I just can't seem to get my syntax right!

Re: MACD / Stoch useage [Re: TraderTom] #482598
03/05/21 08:33
03/05/21 08:33
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Read the manual how to call an indicator, and call MACD _before_ the advise function. Then use the returned rMACDHist for the histogram line.

Re: MACD / Stoch useage [Re: TraderTom] #482599
03/05/21 09:49
03/05/21 09:49
Joined: May 2015
Posts: 390
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 390
Czech Republic
something like this:

Code
		vars Price = series(priceClose());
		
		vars Fast = series(MACD(Price,12,26,9));
		var 	rSig = rMACDSignal,                             <--- read manual
			rHist=rMACDHist;

              

Re: MACD / Stoch useage [Re: TraderTom] #482601
03/05/21 13:13
03/05/21 13:13
Joined: Jan 2021
Posts: 18
London
T
TraderTom Offline OP
Newbie
TraderTom  Offline OP
Newbie
T

Joined: Jan 2021
Posts: 18
London
Thanks!

Chiefengineer being asn helpful and welcoming as ever.....


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1