Gamestudio Links
Zorro Links
Newest Posts
AssetsSP50.csv
by oldflatop. 04/19/21 10:21
Experience with Dukascopy plugin
by Hajoha. 04/19/21 09:11
OANDA-US No Balance Showing
by nullantechamber. 04/18/21 10:24
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/17/21 15:55
Script Template
by DdlV. 04/17/21 15:07
Sierra Chart Plugin
by AndrewAMD. 04/16/21 13:21
AUM Magazine
Latest Screens
Hecknex World
Scheherazade's Journey
Paradox Vector
The Space Between
Who's Online Now
7 registered members (AndrewAMD, oldflatop, Hajoha, AdamWu, Quad, 2 invisible), 409 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
nayan, taygeezy, dadbean, VizTra, simonkrebs
18629 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: 12
London
T
TraderTom Offline OP
Newbie
TraderTom  Offline OP
Newbie
T

Joined: Jan 2021
Posts: 12
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,479
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,479
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: 366
Czech Republic
G
Grat Offline
Senior Member
Grat  Offline
Senior Member
G

Joined: May 2015
Posts: 366
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: 12
London
T
TraderTom Offline OP
Newbie
TraderTom  Offline OP
Newbie
T

Joined: Jan 2021
Posts: 12
London
Thanks!

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


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1