ho costruito un TS con un pattern che simula il Ross Hook long/short con il formula wizard (non riesco ad usare l'editor non ci riuscirò mai)!!!
per favore mi sapreste modificare il punto di entry che corrisponda al break della barra "high(-1)" per entry long; e al break della barra low(-1) per entry short
attualmente la barra high(1) e low(1) entra al superamento della barra correttamente ma mi apre al prezzo di Open
grazie infinite
paolo
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
var vLastAlert = -1;
//}}EFSWizard_Declarations
function preMain() {
//{{EFSWizard_Code_PreMain_setPriceBarColor
setColorPriceBars(true);
//}}EFSWizard_Code_PreMain_setPriceBarColor
/**
* 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("pattern paolo metastock ");
//}}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 (
high() < high(-1) &&
high(-1) > high(-2) &&
high(-2) > high(-3) &&
low() > low(-3) &&
high(1) > high(-1)
) onAction1()
//}}EFSWizard_Expression_1
//{{EFSWizard_Expression_2
else if (
low() > low(-1) &&
low(-1) < low(-2) &&
low(-2) < low(-3) &&
high() < high(-3) &&
low(1) < low(-1)
) 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() {
setPriceBarColor(Color.RGB(0,0,255));
if (vLastAlert != 1) Strategy.doLong("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//{{EFSWizard_Action_2
function onAction2() {
setPriceBarColor(Color.RGB(255,0,0));
if (vLastAlert != 2) Strategy.doShort("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 2;
}
//}}EFSWizard_Action_2
//{{EFSWizard_Action_3
function onAction3() {
setPriceBarColor(Color.RGB(255,0,255));
vLastAlert = 3;
}
//}}EFSWizard_Action_3
//}}EFSWizard_Actions
per favore mi sapreste modificare il punto di entry che corrisponda al break della barra "high(-1)" per entry long; e al break della barra low(-1) per entry short
attualmente la barra high(1) e low(1) entra al superamento della barra correttamente ma mi apre al prezzo di Open
grazie infinite
paolo
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description
//{{EFSWizard_Declarations
var vLastAlert = -1;
//}}EFSWizard_Declarations
function preMain() {
//{{EFSWizard_Code_PreMain_setPriceBarColor
setColorPriceBars(true);
//}}EFSWizard_Code_PreMain_setPriceBarColor
/**
* 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("pattern paolo metastock ");
//}}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 (
high() < high(-1) &&
high(-1) > high(-2) &&
high(-2) > high(-3) &&
low() > low(-3) &&
high(1) > high(-1)
) onAction1()
//}}EFSWizard_Expression_1
//{{EFSWizard_Expression_2
else if (
low() > low(-1) &&
low(-1) < low(-2) &&
low(-2) < low(-3) &&
high() < high(-3) &&
low(1) < low(-1)
) 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() {
setPriceBarColor(Color.RGB(0,0,255));
if (vLastAlert != 1) Strategy.doLong("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//{{EFSWizard_Action_2
function onAction2() {
setPriceBarColor(Color.RGB(255,0,0));
if (vLastAlert != 2) Strategy.doShort("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 2;
}
//}}EFSWizard_Action_2
//{{EFSWizard_Action_3
function onAction3() {
setPriceBarColor(Color.RGB(255,0,255));
vLastAlert = 3;
}
//}}EFSWizard_Action_3
//}}EFSWizard_Actions
Comment