ATR smoothing or indicator smoothing

Hi All,

I am a long time user of metastock. Because metastock is kind of obsolete and keep give me an head ache. I am thinking of migrating my syntax to amibroker. I am just wondering if you could

  1. give me an example code for smoothing ATR with alma or ehler zero lag while I know ATR and wilders is an inbuilt function but anychance we can have a sneak peak? I tried to google it up but then it is taking me to membership area. I am just trying to get my feet wet during this trial period and once it is done I am looking to convert everything in afl
  2. Another example of smoothing rsi with moving average in metastock is Mov((RSI,14),5,S). in plain language: a 5 days average of 14 days of closing price of RSI
  3. in metastock there is a binary line which can be used to see the signal from that indicator that we wrote. Anything like this in amibroker or a platform where I can use to put a finished indicator that I code so it has pointing figure like in metastock?

thanks very much in advance

@tng12 welcome!

Re the ALMA indicator, please, look here.

@tng12

porting Metastock code to AmiBroker, in general, is not difficult since the syntax is similar.

In AmiBroker there are several distinct native functions to calculate a "moving average" like:

  • DEMA - double exponential moving average (AFL 2.0)
  • EMA - exponential moving average
  • HMA - Hull Moving Average (AFL 3.40)
  • MA - simple moving average
  • TEMA - triple exponential moving average (AFL 2.0)
  • Wilders - Wilder's smoothing (AFL 1.4)
  • WMA - weighted moving average (AFL 2.0)

A simple example:

Plot(RSI(14), "RSI", colorRed, styleThick);

smoothedRSI = MA(RSI(14), 20); // 20 periods SIMPLE moving average applied to RSI 14 periods 
Plot(smoothedRSI, "MA(RSI)", colorOrange, styleDashed);

esmoothedRSI = EMA(RSI(14), 20); // 20 periods EXPONENTIAL moving average applied to RSI 14 periods 
Plot(esmoothedRSI, "EMA(RSI)", colorYellow, styleDashed);

This very useful page lists all the AmiBroker native functions categorically. The ones I cited above are in the Moving averages, summation section.

In any case, I suggest you to also search this forum to find more examples that implement some advanced features like the AMA(): adaptive moving average or how to apply the IIR(): infinite impulse response filter.

This other link will bring you to an implementation of the Ehler's RocketRSI.

P.S. I do not understand your point 3 (since I never used MS). Could you elaborate a bit or post an image to better explain it?

3 Likes

@tng12, Like @beppe, I am not a MS user, so please excuse me if I am guessing incorrectly...

For your item 3 - You might be able to use Ribbons.

Here is some code from @portfoliobuilder that may give you an idea of how it could work. S&C Magazine Jan 2018 Traders Tips

Hi beppe,

Can we change that price section with data arrays? Such as open or high, volume and etc, etc?

Thank you buddy. It is similar to what I am looking for

@tng12, SEARCH is your friend...

See @beppe response in this thread: RSI plotting custom array