Hello All;
I was curious if this can be done. I'm looking to look at the Volume for the last 10 days, like the Donchian, so IF the Volume is greater today then the last 10 days AND the close>=open give a BUY signal. and IF the close<=open and the Volume is greater to day then the last 10 days give a SELL signal. Here is my EFS so far, but it doesn't work, can someone help?
THX...Greg
//{{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("Volume Donchian");
setCursorLabelName("?", 0);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarThickness(1, 0);
setPlotType(PLOTTYPE_LINE, 0);
//}}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 (
volume() >= volume(0, -10) &&
open() >= close()
) onAction1()
//}}EFSWizard_Expression_1
//{{EFSWizard_Expression_2
else if (
volume() >= volume(0, -10) &&
close() <= open()
) onAction2();
//}}EFSWizard_Expression_2
//}}EFSWizard_Expressions
//{{EFSWizard_Return
return ;
//}}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() {
Strategy.doLong("BUY", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Ding.wav");
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//{{EFSWizard_Action_2
function onAction2() {
Strategy.doShort("SELL", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Ohno.wav");
vLastAlert = 2;
}
//}}EFSWizard_Action_2
//}}EFSWizard_Actions
I was curious if this can be done. I'm looking to look at the Volume for the last 10 days, like the Donchian, so IF the Volume is greater today then the last 10 days AND the close>=open give a BUY signal. and IF the close<=open and the Volume is greater to day then the last 10 days give a SELL signal. Here is my EFS so far, but it doesn't work, can someone help?
THX...Greg
//{{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("Volume Donchian");
setCursorLabelName("?", 0);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarFgColor(Color.red, 0);
setDefaultBarThickness(1, 0);
setPlotType(PLOTTYPE_LINE, 0);
//}}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 (
volume() >= volume(0, -10) &&
open() >= close()
) onAction1()
//}}EFSWizard_Expression_1
//{{EFSWizard_Expression_2
else if (
volume() >= volume(0, -10) &&
close() <= open()
) onAction2();
//}}EFSWizard_Expression_2
//}}EFSWizard_Expressions
//{{EFSWizard_Return
return ;
//}}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() {
Strategy.doLong("BUY", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Ding.wav");
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//{{EFSWizard_Action_2
function onAction2() {
Strategy.doShort("SELL", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Ohno.wav");
vLastAlert = 2;
}
//}}EFSWizard_Action_2
//}}EFSWizard_Actions
Comment