Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 600 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
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