Page 1 of 1
SMA - Simple Moving Average
Posted: Sun 14 Jan 2024 9:33 pm
by packman2008
As I work my way through understanding how the Chart Compiler works there will probably be some questions like this. I hope this is a good place to ask them?
The Wiki describes the SMA option in STATS, but doesn't state what the default averaging period is. There's also a note that you can alter the period using a parameter, but I've not found any examples of different averaging periods being specified so the format isn't clear, e.g. how is the parameter added and what format is it in (hours, days, ?).
Re: SMA - Simple Moving Average
Posted: Sun 14 Jan 2024 9:54 pm
by HansR
This seems the right place yes
The period for the
Simple Moving Average is currently determined by the parameter
PeriodMovingAverage (see the page
CDL - STATS.
There is one parameter over the whole CUtils which contains the nr of periods for the SMA. That may be not enough.
The default for the parameter is 180 periods. So that is days for the ALL and DAILY charts and for the RECENT and EXTRA charts that would be the number of samples which is determined by the log frequency of the data.
I am willing to think on how to fine tune / improve this.
Hope this clarifies.
Re: SMA - Simple Moving Average
Posted: Sun 14 Jan 2024 10:00 pm
by packman2008
Thanks Hans.
I assumed it was a parameter in CutilsCharts.def and I didn't think to look in the .ini file.
I don't know if multiple periods would be required though. I'm still learning the basics of all the knobs and switches in CDL before I try to embark on building any new charts.
Re: SMA - Simple Moving Average
Posted: Sun 14 Jan 2024 10:05 pm
by HansR
OK... for the time being that single parameter will do than I suppose.
Re: SMA - Simple Moving Average
Posted: Thu 18 Jan 2024 10:41 am
by HansR
I decided to add a language construct to CDL as is already currently visible in
the Wiki.
So, when you want an SMA line in a chart, you can optionally think of adding a period (when not given it will have a default about which I am thinking as it needs one for RECENT and one for ALL)
This will only be available in version 7 of CUtils which depends on CMX so uncertain release date atm.
Re: SMA - Simple Moving Average
Posted: Thu 18 Jan 2024 10:50 am
by packman2008
Thanks Hans. I'll look forward to seeing the new CMX and CU when they appear.