i am a new user and i used the formula wizard for the first time in order to make a test with macd.
the formula works but i realized that it misses some signals!!
i will give you the formula here and please tell me what is wrong with it:
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description 7532
//{{EFSWizard_Declarations
var vMACD12_26 = new MACDStudy(12, 26, 9, "Close", false);
var vLastAlert = -1;
//}}EFSWizard_Declarations 9531
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("MACD");
//}}EFSWizard_PreMain 5989
}
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 (
vMACD12_26.getValue(MACDStudy.SIGNAL) > vMACD12_26.getValue(MACDStudy.MACD)
) onAction1()
//}}EFSWizard_Expression_1 12826
//{{EFSWizard_Expression_2
else if (
vMACD12_26.getValue(MACDStudy.SIGNAL, 0, 0) > vMACD12_26.getValue(MACDStudy.MACD)
) onAction2();
//}}EFSWizard_Expression_2 16066
//}}EFSWizard_Expressions 49890
//{{EFSWizard_Return
return null;
//}}EFSWizard_Return 2256
}
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() {
if (vLastAlert != 1) drawShapeRelative(1, high(1), Shape.DOWNARROW, "", Color.RGB(128,0,37), Shape.BOTTOM);
if (vLastAlert != 1) setBarBgColor(Color.RGB(255,255,160));
vLastAlert = 1;
}
//}}EFSWizard_Action_1 27875
//{{EFSWizard_Action_2
function onAction2() {
if (vLastAlert != 2) drawShapeRelative(1, low(1), Shape.UPARROW, "", Color.RGB(0,128,18), Shape.TOP);
if (vLastAlert != 2) setBarBgColor(Color.RGB(233,255,255));
vLastAlert = 2;
}
//}}EFSWizard_Action_2 27587
//}}EFSWizard_Actions 72540
it works fine on the 5' chart but it misses trades on the 3' chart!
i am going crazy! why is that?
the formula works but i realized that it misses some signals!!
i will give you the formula here and please tell me what is wrong with it:
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description 7532
//{{EFSWizard_Declarations
var vMACD12_26 = new MACDStudy(12, 26, 9, "Close", false);
var vLastAlert = -1;
//}}EFSWizard_Declarations 9531
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("MACD");
//}}EFSWizard_PreMain 5989
}
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 (
vMACD12_26.getValue(MACDStudy.SIGNAL) > vMACD12_26.getValue(MACDStudy.MACD)
) onAction1()
//}}EFSWizard_Expression_1 12826
//{{EFSWizard_Expression_2
else if (
vMACD12_26.getValue(MACDStudy.SIGNAL, 0, 0) > vMACD12_26.getValue(MACDStudy.MACD)
) onAction2();
//}}EFSWizard_Expression_2 16066
//}}EFSWizard_Expressions 49890
//{{EFSWizard_Return
return null;
//}}EFSWizard_Return 2256
}
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() {
if (vLastAlert != 1) drawShapeRelative(1, high(1), Shape.DOWNARROW, "", Color.RGB(128,0,37), Shape.BOTTOM);
if (vLastAlert != 1) setBarBgColor(Color.RGB(255,255,160));
vLastAlert = 1;
}
//}}EFSWizard_Action_1 27875
//{{EFSWizard_Action_2
function onAction2() {
if (vLastAlert != 2) drawShapeRelative(1, low(1), Shape.UPARROW, "", Color.RGB(0,128,18), Shape.TOP);
if (vLastAlert != 2) setBarBgColor(Color.RGB(233,255,255));
vLastAlert = 2;
}
//}}EFSWizard_Action_2 27587
//}}EFSWizard_Actions 72540
it works fine on the 5' chart but it misses trades on the 3' chart!
i am going crazy! why is that?
Comment