Could someone help me with this formula?
I'm tring to use the Accumulation/Distribution with a 10 EMA.
All I get is the ACC/DIST but NO MA
Thanks for your time...Greg
Formula Configuration"ACC/DIST MA", a non-price study, returns 2 data points for each bar. edit
Studies Used
variable name study
vAccDist AccDistStudy() edit X
vEMA10 MAStudy(10, 0, "Close", MAStudy.EXPONENTIAL) edit X
add study
Set 1Set 2 X+
If these conditions are all true:
add line... then the following will happen everytime:
add line... while the following will happen only the first time:
add lineReturned Data Points
This study will plot 2 data points edit for each bar:
ACC/DIST edit
MA edit
check EFS syntax
Generated EFS Code
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
var vAccDist = new AccDistStudy();
var vEMA10 = new MAStudy(10, 0, "Close", MAStudy.EXPONENTIAL);
var vLastAlert = -1;
//}}EFSWizard_Declarations
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(false);
setStudyTitle("ACC/DIST MA");
setCursorLabelName("ACC/DIST ", 0);
setCursorLabelName("MA", 1);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarThickness(2, 0);
setDefaultBarThickness(2, 1);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
//}}EFSWizard_PreMain
}
function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/
//{{EFSWizard_Expressions
//{{EFSWizard_Expression_1
//}}EFSWizard_Expression_1
//}}EFSWizard_Expressions
//{{EFSWizard_Return
return new Array(
close(),
vEMA10.getValue(MAStudy.MA, 0, 10)
);
//}}EFSWizard_Return
}
function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}
//{{EFSWizard_Actions
//{{EFSWizard_Action_1
function onAction1() {
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//}}EFSWizard_Actions
I'm tring to use the Accumulation/Distribution with a 10 EMA.
All I get is the ACC/DIST but NO MA
Thanks for your time...Greg
Formula Configuration"ACC/DIST MA", a non-price study, returns 2 data points for each bar. edit
Studies Used
variable name study
vAccDist AccDistStudy() edit X
vEMA10 MAStudy(10, 0, "Close", MAStudy.EXPONENTIAL) edit X
add study
Set 1Set 2 X+
If these conditions are all true:
add line... then the following will happen everytime:
add line... while the following will happen only the first time:
add lineReturned Data Points
This study will plot 2 data points edit for each bar:
ACC/DIST edit
MA edit
check EFS syntax
Generated EFS Code
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
var vAccDist = new AccDistStudy();
var vEMA10 = new MAStudy(10, 0, "Close", MAStudy.EXPONENTIAL);
var vLastAlert = -1;
//}}EFSWizard_Declarations
function preMain() {
/**
* This function is called only once, before any of the bars are loaded.
* Place any study or EFS configuration commands here.
*/
//{{EFSWizard_PreMain
setPriceStudy(false);
setStudyTitle("ACC/DIST MA");
setCursorLabelName("ACC/DIST ", 0);
setCursorLabelName("MA", 1);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarStyle(PS_SOLID, 1);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarThickness(2, 0);
setDefaultBarThickness(2, 1);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_LINE, 1);
//}}EFSWizard_PreMain
}
function main() {
/**
* The main() function is called once per bar on all previous bars, once per
* each incoming completed bar, and if you don't have 'setComputeOnClose(true)'
* in your preMain(), it is also called on every tick.
*/
//{{EFSWizard_Expressions
//{{EFSWizard_Expression_1
//}}EFSWizard_Expression_1
//}}EFSWizard_Expressions
//{{EFSWizard_Return
return new Array(
close(),
vEMA10.getValue(MAStudy.MA, 0, 10)
);
//}}EFSWizard_Return
}
function postMain() {
/**
* The postMain() function is called only once, when the EFS is no longer used for
* the current symbol (ie, symbol change, chart closing, or application shutdown).
*/
}
//{{EFSWizard_Actions
//{{EFSWizard_Action_1
function onAction1() {
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//}}EFSWizard_Actions
Comment