I have written a very simple EFS to get the value of the CCI indicator, using Alexis' EFS. It works great, but I want to access the CCI values from one and two bars prior. How do I do that?
Below is my EFS code.
Thanks for any help.
John
/************************************************** *******
Alexis C. Montenegro © April 2003
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a
description of any changes you make.
************************************************** ********/
var vCCI = null;
var dde1 = new DDEOutput("CCIvalue1"); //This is for DDE output to Excel file
function preMain() {
setStudyTitle("CCI for DDE"); //Sets the title in the formulas pullout on charts
setCursorLabelName("CCI for DDE", 0); //Sets name in cursor window
}
function main() {
if (vCCI == null) vCCI = new CCIStudy(14, "HLC/3");
/********************************************
Insert your code following this text block
Use vCCI.getValue(CCIStudy.CCI) for your code
*********************************************/
dde1.set(vCCI.getValue(CCIStudy.CCI)); // Assign current CCI value to the DDE
// HOW DO I GET THE CCI VALUE FROM ONE BAR PRIOR???
return vCCI.getValue(CCIStudy.CCI);
}
Below is my EFS code.
Thanks for any help.
John
/************************************************** *******
Alexis C. Montenegro © April 2003
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a
description of any changes you make.
************************************************** ********/
var vCCI = null;
var dde1 = new DDEOutput("CCIvalue1"); //This is for DDE output to Excel file
function preMain() {
setStudyTitle("CCI for DDE"); //Sets the title in the formulas pullout on charts
setCursorLabelName("CCI for DDE", 0); //Sets name in cursor window
}
function main() {
if (vCCI == null) vCCI = new CCIStudy(14, "HLC/3");
/********************************************
Insert your code following this text block
Use vCCI.getValue(CCIStudy.CCI) for your code
*********************************************/
dde1.set(vCCI.getValue(CCIStudy.CCI)); // Assign current CCI value to the DDE
// HOW DO I GET THE CCI VALUE FROM ONE BAR PRIOR???
return vCCI.getValue(CCIStudy.CCI);
}
Comment