I wanted to take the current bar value and subtract it from the last bars value. Then that number could then look up in a matching table what to display on the screen. This would show the degrees of the line.
Table example
Difference of 3 would display 3 degrees
Difference of 7 would display 9 degrees
I would fill in the rest.
Display on chart Like this if
{
drawTextRelative(1, 80, "Sell right now @ " + close(), Color.black, Color.red, Text.FRAME | Text.RELATIVETOP | Text.BOLD, null, null, "OS");
} else if {
drawTextRelative(1, 20, "Buy right now @ " + close(), Color.black, Color.green, Text.BUTTON | Text.BOLD, null, null, "OB");
}
and so on. I would have to fill in correct values for EURO as one EFS, Russell as one EFS and Bond as one EFS. Once this is doe it never has to change.
You know woodies rules. Never trade with a 34EMA with less then 15 degrees, and this has kept me out of al lot of chop.
I noticed that the 34EMA attached was done in the wizard and wondering if you can figures out on the wizard if this is possible and if you could do it and I will do the tables of degrees of 0 degrees to 90.
Below is the EFS which was made in the E Signal wizzard that this feature would be added to.
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description 7532
//{{EFSWizard_Declarations
var vEMA34_of_HLC3 = new MAStudy(34, 0, "HLC/3", MAStudy.EXPONENTIAL);
var vLastAlert = -1;
//}}EFSWizard_Declarations 12193
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("34 EMA");
setCursorLabelName("34 EMA", 0);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarThickness(3, 0);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_INSTANTCOLORLINE,0);
//}}EFSWizard_PreMain 30539
}
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() > vEMA34_of_HLC3.getValue(MAStudy.MA)
) onAction1()
//}}EFSWizard_Expression_1 9296
//{{EFSWizard_Expression_2
else if (
close() < vEMA34_of_HLC3.getValue(MAStudy.MA)
) onAction2();
//}}EFSWizard_Expression_2 11350
//}}EFSWizard_Expressions 38428
//{{EFSWizard_Return
return vEMA34_of_HLC3.getValue(MAStudy.MA);
//}}EFSWizard_Return 5919
}
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() {
setBarFgColor(Color.aqua);
if (vLastAlert != 1) Strategy.doLong("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 1;
}
//}}EFSWizard_Action_1 24209
//{{EFSWizard_Action_2
function onAction2() {
setBarFgColor(Color.maroon);
if (vLastAlert != 2) Strategy.doShort("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 2;
}
//}}EFSWizard_Action_2 22305
//}}EFSWizard_Actions 67343
Table example
Difference of 3 would display 3 degrees
Difference of 7 would display 9 degrees
I would fill in the rest.
Display on chart Like this if
{
drawTextRelative(1, 80, "Sell right now @ " + close(), Color.black, Color.red, Text.FRAME | Text.RELATIVETOP | Text.BOLD, null, null, "OS");
} else if {
drawTextRelative(1, 20, "Buy right now @ " + close(), Color.black, Color.green, Text.BUTTON | Text.BOLD, null, null, "OB");
}
and so on. I would have to fill in correct values for EURO as one EFS, Russell as one EFS and Bond as one EFS. Once this is doe it never has to change.
You know woodies rules. Never trade with a 34EMA with less then 15 degrees, and this has kept me out of al lot of chop.
I noticed that the 34EMA attached was done in the wizard and wondering if you can figures out on the wizard if this is possible and if you could do it and I will do the tables of degrees of 0 degrees to 90.
Below is the EFS which was made in the E Signal wizzard that this feature would be added to.
//{{EFSWizard_Description
//
// This formula was generated by the Alert Wizard
//
//}}EFSWizard_Description 7532
//{{EFSWizard_Declarations
var vEMA34_of_HLC3 = new MAStudy(34, 0, "HLC/3", MAStudy.EXPONENTIAL);
var vLastAlert = -1;
//}}EFSWizard_Declarations 12193
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("34 EMA");
setCursorLabelName("34 EMA", 0);
setDefaultBarStyle(PS_SOLID, 0);
setDefaultBarThickness(3, 0);
setPlotType(PLOTTYPE_LINE, 0);
setPlotType(PLOTTYPE_INSTANTCOLORLINE,0);
//}}EFSWizard_PreMain 30539
}
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() > vEMA34_of_HLC3.getValue(MAStudy.MA)
) onAction1()
//}}EFSWizard_Expression_1 9296
//{{EFSWizard_Expression_2
else if (
close() < vEMA34_of_HLC3.getValue(MAStudy.MA)
) onAction2();
//}}EFSWizard_Expression_2 11350
//}}EFSWizard_Expressions 38428
//{{EFSWizard_Return
return vEMA34_of_HLC3.getValue(MAStudy.MA);
//}}EFSWizard_Return 5919
}
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() {
setBarFgColor(Color.aqua);
if (vLastAlert != 1) Strategy.doLong("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 1;
}
//}}EFSWizard_Action_1 24209
//{{EFSWizard_Action_2
function onAction2() {
setBarFgColor(Color.maroon);
if (vLastAlert != 2) Strategy.doShort("", Strategy.CLOSE, Strategy.THISBAR, Strategy.DEFAULT, 0);
vLastAlert = 2;
}
//}}EFSWizard_Action_2 22305
//}}EFSWizard_Actions 67343
Comment