Hi, the following works fine for me except it doesnt just work from JUST the current bar backwards. E.g. it looks for 3 down bars in a row, it will highlight the last time there were 3 down bars when all i want it to do is alert me when the current bar is the 3rd down bar. E.g. if i have had 3 down bars and then an up bar, the last down bar will be highlighted, i dont want it to be, I only want the alert when the current bar is a the 3rd of 3 down bars, this is kinda hard to explain, i hope i have done so ok.
Thanks in advance for any assistance. (ps is there any way that I can get test to appear as well as the shape ? Maybe even the price ((high & low) Greedy)?)
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
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(true);
setStudyTitle("3 bar dec");
//}}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
if (
close() < open() &&
close(-1) < open(-1) &&
close(-2) < open(-2)
) onAction1();
//}}EFSWizard_Expression_1
//}}EFSWizard_Expressions
//{{EFSWizard_Return
return null;
//}}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() {
drawShapeRelative(0, low(), Shape.CIRCLE, "", Color.RGB(155,0,0), Shape.LEFT, "3 bar dec.");
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//}}EFSWizard_Actions
Thanks in advance for any assistance. (ps is there any way that I can get test to appear as well as the shape ? Maybe even the price ((high & low) Greedy)?)
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
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(true);
setStudyTitle("3 bar dec");
//}}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
if (
close() < open() &&
close(-1) < open(-1) &&
close(-2) < open(-2)
) onAction1();
//}}EFSWizard_Expression_1
//}}EFSWizard_Expressions
//{{EFSWizard_Return
return null;
//}}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() {
drawShapeRelative(0, low(), Shape.CIRCLE, "", Color.RGB(155,0,0), Shape.LEFT, "3 bar dec.");
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//}}EFSWizard_Actions
Comment