Accelerator Oscillator & Awesome Oscillator

Posted By: Maruska

Accelerator Oscillator & Awesome Oscillator - 01/30/13 15:12

Where are AC & AO indicators? Zorro missed them?
Posted By: jcl

Re: Accelerator Oscillator & Awesome Oscillator - 01/30/13 16:09

Zorro has the 150 most important indicators, but there are many, many more. We're certainly not going to implement them all, as most indicators are useless anyway.

But if you want a certain indicator, find out its algorithm and just try implementing it yourself. With some experience you can implement a simple indicator in 2 minutes. I'll help you. You can post your code here and I'll check and fix it if necessary.
Posted By: Maruska

Re: Accelerator Oscillator & Awesome Oscillator - 01/30/13 16:14

Ok,
I'll try to implement them.

These are the formulas:
MEDIAN PRICE = (HIGH+LOW)/2
AO = SMA(MEDIAN PRICE, 5)-SMA(MEDIAN PRICE, 34)
AC = AO-SMA(AO, 5)

I've tried this in zorro but don't work:

vars median_price = series(MidPrice());
var ao = SMA(median_price,5)-SMA(median_price,34);
var ac = ao-SMA(ao, 5);
Posted By: jcl

Re: Accelerator Oscillator & Awesome Oscillator - 01/30/13 17:46

This is not too bad. It's almost right, only two mistakes:

vars median_price = series(MidPrice());

There is no such thing as "MidPrice()". Why don't you use your own formula above?

var ac = ao-SMA(ao, 5);

Correct, only SMA - like all indicators - needs a series and not a var.
Posted By: Maruska

Re: Accelerator Oscillator & Awesome Oscillator - 01/30/13 20:44

I took the wrong indicator MidPrice. It should be MedPrice.
As the manual says:

MedPrice(): var
Median Price. Simply (High+Low)/2 over only one bar.

About SMA that needs a series but I have used a var. Ok but how can I get a series result?

Something like this?
vars ao = series(SMA(median_price,5))-series(SMA(median_price,34));
Posted By: jcl

Re: Accelerator Oscillator & Awesome Oscillator - 01/31/13 08:35

You can not subtract series, but you can subtract numbers.

vars ao = series(SMA(median_price,5) - SMA(median_price,34));
var ac = ao[0] - SMA(ao,5);

or

var ao = SMA(median_price,5) - SMA(median_price,34);
var ac = ao - SMA(series(ao),5);
Posted By: Maruska

Re: Accelerator Oscillator & Awesome Oscillator - 01/31/13 08:51

Ok, I understand.

And If I want also ac as a series:

vars ac = series(ao - SMA(ao,5));

this is correct?
Posted By: jcl

Re: Accelerator Oscillator & Awesome Oscillator - 01/31/13 09:41

Almost. If you use the first method, it would be:

vars ac = series(ao[0] - SMA(ao,5));

If ao is already a series, ao[0] is its current value.
Posted By: Maruska

Re: Accelerator Oscillator & Awesome Oscillator - 01/31/13 11:02

Ok, thank you very much!
Posted By: deweymcg

Re: Accelerator Oscillator & Awesome Oscillator - 05/18/13 23:21

a question I have: some strategies are based on whether the AO or AC is above 0, others are based on what color it is. How would you call one versus the other based on the strategy you are trying to test?

I assume the value would show whether it was above or below 0 but how do you know what color it would be on the chart?
Posted By: jcl

Re: Accelerator Oscillator & Awesome Oscillator - 05/20/13 10:56

An indicator has no color. It only has a value. So a strategy can not be based on a color of an indicator.

If a script draws an indicators curve in different colors, ask the developer of this script what the colors mean. For instance, they can mean that the value is above or below zero. That is then probably where those strategies are based on.
© 2024 lite-C Forums