Can someone help me?
Here is Alex's efs for the MA of the MOM.
I'm just trying to get it to draw an arrow on the price chart with an audible alert. when the MOM goes south of the MA.
Thanks for your time...Greg
/************************************************** *******
Alexis C. Montenegro © December 2004
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a
description of any changes you make.
************************************************** ********/
var fpArray = new Array();
function preMain() {
setStudyTitle("MAofMOM");
setCursorLabelName("MOM", 0);
setCursorLabelName("MAofMOM", 1);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarThickness(1,0);
setDefaultBarThickness(1,1);
askForInput();
var x=0;
fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(10);
}
fpArray[x] = new FunctionParameter("Source", FunctionParameter.STRING);
with(fpArray[x++]){
addOption("open");
addOption("high");
addOption("low");
addOption("close");
addOption("hl2");
addOption("hlc3");
addOption("ohlc4");
setDefault("close");
}
fpArray[x] = new FunctionParameter("Symbol", FunctionParameter.STRING);
with(fpArray[x++]){
setDefault();
}
fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING);
with(fpArray[x++]){
setDefault();
}
fpArray[x] = new FunctionParameter("MAType", FunctionParameter.STRING);
with(fpArray[x++]){
addOption("sma");
addOption("ema");
addOption("wma");
setDefault("sma");
}
fpArray[x] = new FunctionParameter("MALength", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(10);
}
fpArray[x] = new FunctionParameter("LineColor1", FunctionParameter.COLOR);
with(fpArray[x++]){
setName("Color1");
setDefault(Color.blue);
}
fpArray[x] = new FunctionParameter("LineColor2", FunctionParameter.COLOR);
with(fpArray[x++]){
setName("Color2");
setDefault(Color.red);
}
fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN);
with(fpArray[x++]){
setName("Show Parameters");
setDefault(false);
}
}
var bInit = false;
var xMOM = null;
var xMAofMOM = null;
function main(Length,Source,Symbol,Interval,MAType,MALength ,LineColor1,LineColor2,Params) {
if(bInit == false){
if(Symbol == null) Symbol = getSymbol();
if(Interval == null) Interval = getInterval();
var vSymbol = Symbol+","+Interval;
xMOM = mom(Length,eval(Source)(sym(vSymbol)));
xMAofMOM = eval(MAType)(MALength,mom(Length,eval(Source)(sym( vSymbol))));
setDefaultBarFgColor(LineColor1,0);
setDefaultBarFgColor(LineColor2,1);
setShowTitleParameters(eval(Params));
bInit = true;
}
return new Array (getSeries(xMOM),getSeries(xMAofMOM));
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() {
drawTextRelative(0, high(), "ê", Color.red, null, Text.BOTTOM|Text.CENTER|Text.BOLD, "Wingdings", 10);
Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Ohno.wav");
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//}}EFSWizard_Actions
}
Here is Alex's efs for the MA of the MOM.
I'm just trying to get it to draw an arrow on the price chart with an audible alert. when the MOM goes south of the MA.
Thanks for your time...Greg
/************************************************** *******
Alexis C. Montenegro © December 2004
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a
description of any changes you make.
************************************************** ********/
var fpArray = new Array();
function preMain() {
setStudyTitle("MAofMOM");
setCursorLabelName("MOM", 0);
setCursorLabelName("MAofMOM", 1);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarThickness(1,0);
setDefaultBarThickness(1,1);
askForInput();
var x=0;
fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(10);
}
fpArray[x] = new FunctionParameter("Source", FunctionParameter.STRING);
with(fpArray[x++]){
addOption("open");
addOption("high");
addOption("low");
addOption("close");
addOption("hl2");
addOption("hlc3");
addOption("ohlc4");
setDefault("close");
}
fpArray[x] = new FunctionParameter("Symbol", FunctionParameter.STRING);
with(fpArray[x++]){
setDefault();
}
fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING);
with(fpArray[x++]){
setDefault();
}
fpArray[x] = new FunctionParameter("MAType", FunctionParameter.STRING);
with(fpArray[x++]){
addOption("sma");
addOption("ema");
addOption("wma");
setDefault("sma");
}
fpArray[x] = new FunctionParameter("MALength", FunctionParameter.NUMBER);
with(fpArray[x++]){
setLowerLimit(1);
setDefault(10);
}
fpArray[x] = new FunctionParameter("LineColor1", FunctionParameter.COLOR);
with(fpArray[x++]){
setName("Color1");
setDefault(Color.blue);
}
fpArray[x] = new FunctionParameter("LineColor2", FunctionParameter.COLOR);
with(fpArray[x++]){
setName("Color2");
setDefault(Color.red);
}
fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN);
with(fpArray[x++]){
setName("Show Parameters");
setDefault(false);
}
}
var bInit = false;
var xMOM = null;
var xMAofMOM = null;
function main(Length,Source,Symbol,Interval,MAType,MALength ,LineColor1,LineColor2,Params) {
if(bInit == false){
if(Symbol == null) Symbol = getSymbol();
if(Interval == null) Interval = getInterval();
var vSymbol = Symbol+","+Interval;
xMOM = mom(Length,eval(Source)(sym(vSymbol)));
xMAofMOM = eval(MAType)(MALength,mom(Length,eval(Source)(sym( vSymbol))));
setDefaultBarFgColor(LineColor1,0);
setDefaultBarFgColor(LineColor2,1);
setShowTitleParameters(eval(Params));
bInit = true;
}
return new Array (getSeries(xMOM),getSeries(xMAofMOM));
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() {
drawTextRelative(0, high(), "ê", Color.red, null, Text.BOTTOM|Text.CENTER|Text.BOLD, "Wingdings", 10);
Alert.playSound("C:\\Program Files\\eSignal\\Sounds\\Ohno.wav");
vLastAlert = 1;
}
//}}EFSWizard_Action_1
//}}EFSWizard_Actions
}
Comment