Hi!
I am using Alexis' amVWAP.efs and it is working fine. However, I am trying to extract the current value so that I can set up an alert and am not having any luck.
I added the code after the return xVWAP; statement.
Thank you, Charley
/************************************************** *******
Alexis C. Montenegro © July 2005
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.
************************************************** ********/
// NOTE:
// This efs requires amStudies.efsLib in the FunctionLibrary folder.
// If you do not have this file you can download it at the link below.
// http://share.esignal.com/groupconten...ies&groupid=10
var fpArray = new Array();
function preMain() {
setPriceStudy(true);
setStudyTitle("VWAP");
setCursorLabelName("VWAP",0);
setDefaultBarFgColor(Color.blue,0);
setPlotType(PLOTTYPE_SQUAREWAVE,0);
setDefaultBarThickness(1,0);
var x=0;
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("Params", FunctionParameter.BOOLEAN);
with(fpArray[x++]){
setName("Show Parameters");
setDefault(false);
}
}
var amLib = addLibrary("amStudies.efsLib");
var bInit = false;
var xVWAP = null;
var vwap = null;
function main(Symbol,Interval,Params) {
if(bInit == false) {
with(amLib) {
if(Symbol == null) Symbol = getSymbol();
if(Interval == null) Interval = getInterval();
var vSymbol = Symbol + "," + Interval;
xVWAP = getSeries(amVWAP(sym(vSymbol)));
setShowTitleParameters(eval(Params));
bInit = true;
}
}
return xVWAP;
if(vwap == null) vwap = amLib.amVWAP();
var val = vwap.getValue(0);
return val; debugPrintln(val);
}
I am using Alexis' amVWAP.efs and it is working fine. However, I am trying to extract the current value so that I can set up an alert and am not having any luck.
I added the code after the return xVWAP; statement.
Thank you, Charley
/************************************************** *******
Alexis C. Montenegro © July 2005
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.
************************************************** ********/
// NOTE:
// This efs requires amStudies.efsLib in the FunctionLibrary folder.
// If you do not have this file you can download it at the link below.
// http://share.esignal.com/groupconten...ies&groupid=10
var fpArray = new Array();
function preMain() {
setPriceStudy(true);
setStudyTitle("VWAP");
setCursorLabelName("VWAP",0);
setDefaultBarFgColor(Color.blue,0);
setPlotType(PLOTTYPE_SQUAREWAVE,0);
setDefaultBarThickness(1,0);
var x=0;
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("Params", FunctionParameter.BOOLEAN);
with(fpArray[x++]){
setName("Show Parameters");
setDefault(false);
}
}
var amLib = addLibrary("amStudies.efsLib");
var bInit = false;
var xVWAP = null;
var vwap = null;
function main(Symbol,Interval,Params) {
if(bInit == false) {
with(amLib) {
if(Symbol == null) Symbol = getSymbol();
if(Interval == null) Interval = getInterval();
var vSymbol = Symbol + "," + Interval;
xVWAP = getSeries(amVWAP(sym(vSymbol)));
setShowTitleParameters(eval(Params));
bInit = true;
}
}
return xVWAP;
if(vwap == null) vwap = amLib.amVWAP();
var val = vwap.getValue(0);
return val; debugPrintln(val);
}
Comment