Announcement

Collapse
No announcement yet.

MACD, CCI Source Legal Values?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MACD, CCI Source Legal Values?

    I am attempting to use the built-in studies CCI and MACD.

    Both have an optional parameter named source which allows you to specify where the study is getting its data (ie For CCI: HLC/3 or close, or open, etc). The default is always close.

    What values does source accept? If I want to run the CCI built-in study with the source as HLC/3 instead of close what do I change and where do I find the list of allowed values?

    Thanks in advance.

  • #2
    Hello Hexteque,

    In the Function Reference folder of the EFS KnowledgeBase you will find two folders, Built-in Study Functions and Series Functions. Any of these functions create a Series, which can be used as the source for CCI and MACD.

    To use HLC/3 (hlc3()) as the source for the CCI, you could use the following syntax.

    cci(12, hlc3());

    Here's a basic formula example.

    PHP Code:
    var xCCI null;

    function 
    main() {
        if (
    xCCI == null) {  // initialize only once at start up
            
    xCCI cci(12hlc3());
        }
        
        var 
    nCCI xCCI.getValue(0);  // assign current value of cci to nCCI
        
    if (nCCI == null) return;
        
        return 
    nCCI;  // plots the current bar value of cci study

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X