How To Write In Amibroker - Aussie Stock Forums

Thread: How To Write In Amibroker

1. How To Write In Amibroker

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

2. Re: How To Write In Amibroker

Originally Posted by GilR
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)

3. Re: How To Write In Amibroker

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

4. Re: How To Write In Amibroker

So its not to different to Metastock

Gil

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Aussie Stock Forums