Australian (ASX) Stock Market Forum

How To Write In Amibroker

Joined
24 June 2009
Posts
2
Reactions
0
Hi

How do I write this Metastock "if" formula in Amibroker?

If(C/O<1.005 AND C/O>1 OR O/C<1.005 AND O/C>1, or C<O,1,0)

Thanks

Gil
 
Hi

How do I write this Metastock "if" formula in Amibroker?

If(C/O<1.005 AND C/O>1 OR O/C<1.005 AND O/C>1, or C<O,1,0)

Thanks

Gil

IIf(.....etc)

I would write that formula with a few extra brackets

IIf((C/O<1.005 AND C/O>1) OR (O/C<1.005 AND O/C>1) or C<O,1,0)
 
Wayne is correct. I'd tend to use more tabs so it doesn't look like a jungle and you can navigate your way around it easily if you want to change it, or comment some things out to see what happens/or doesn't happen if each part is taken out (if trying to break the system).

Code:
IIf		(	
			(C/O<1.005 && C/O>1) 			//First Condition
			OR									//Or
			(O/C<1.005 && O/C>1 OR C<O)		//Second Condition
		,1 	//If True Return 1
		,0	//If False Return 0
		);

Amibroker treats all spaces , returns etc as "white space", which makes navigating around your code alot easier
Im sort of confused about the last OR

Brad
 
Top