Gamestudio Links
Zorro Links
Newest Posts
Historical Data with the 64bit FXCM Plugin
by Martin_HH. 01/21/26 21:59
Buy A8 Pro Version
by Spirit. 01/21/26 21:37
ZorroGPT
by TipmyPip. 01/20/26 07:17
Bar missing bug?
by jcl. 01/19/26 10:47
400 free seamless texture pack downl. here !
by NeoDumont. 01/18/26 19:09
FXCM demo test failed
by qin. 01/13/26 13:53
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (Martin_HH, Spirit), 6,878 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Castromangos, Quantum, stephensdeborah, promfast, joe_kane
19193 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: 28,052
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,052
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