Is there any way to EFS code, so that the "current bar" information displayed on my Wizard "non price studies" are on every tick and not on CLOSE of the current bar.
'setComputeOnClose(true)' is not in the preMain as advised in the script but even if I put 'setComputeOnClose(false)' in the preMain it is still called on CLOSE, so I'm at a loss as to how to proceed.
If anyone can point me in the right direction or even better supply me with the script change I need, then I can then use the editor to amend and save, rather than use the wizard.
Below is an example of a simple background colour change on Stochastics and I am wanting the current bar to change colours on the tick if applicable and not on CLOSE in this instance.
Many thanks for any help,
TIKTOK
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
var vStoch14_3 = new StochStudy(14, 3, 4);
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("");
//}}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 (
vStoch14_3.getValue(StochStudy.FAST) > vStoch14_3.getValue(StochStudy.SLOW)
) onAction1()
//}}EFSWizard_Expression_1
//{{EFSWizard_Expression_2
else if (
vStoch14_3.getValue(StochStudy.FAST) < vStoch14_3.getValue(StochStudy.SLOW)
) onAction2();
//}}EFSWizard_Expression_2
//}}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() {
setBarBgColor(Color.RGB(204,224,246));
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//{{EFSWizard_Action_2
function onAction2() {
setBarBgColor(Color.RGB(255,195,195));
vLastAlert = 2;
}
//}}EFSWizard_Action_2
//}}EFSWizard_Actions
'setComputeOnClose(true)' is not in the preMain as advised in the script but even if I put 'setComputeOnClose(false)' in the preMain it is still called on CLOSE, so I'm at a loss as to how to proceed.
If anyone can point me in the right direction or even better supply me with the script change I need, then I can then use the editor to amend and save, rather than use the wizard.
Below is an example of a simple background colour change on Stochastics and I am wanting the current bar to change colours on the tick if applicable and not on CLOSE in this instance.
Many thanks for any help,
TIKTOK
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
var vStoch14_3 = new StochStudy(14, 3, 4);
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("");
//}}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 (
vStoch14_3.getValue(StochStudy.FAST) > vStoch14_3.getValue(StochStudy.SLOW)
) onAction1()
//}}EFSWizard_Expression_1
//{{EFSWizard_Expression_2
else if (
vStoch14_3.getValue(StochStudy.FAST) < vStoch14_3.getValue(StochStudy.SLOW)
) onAction2();
//}}EFSWizard_Expression_2
//}}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() {
setBarBgColor(Color.RGB(204,224,246));
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//{{EFSWizard_Action_2
function onAction2() {
setBarBgColor(Color.RGB(255,195,195));
vLastAlert = 2;
}
//}}EFSWizard_Action_2
//}}EFSWizard_Actions
Comment