I got the efs from page 63 04/07/2004. It is called bidaskvolumetotalasline. I made it a histogram and changed it to cumulative askvolume minus bidvolume. It works fine. When I tried to make it a Price study and a Moving average, I ran into a brick wall. If it can be modified by a java speaker I would appreciate it.(It is a modified BidAskVolume.efs)
/************************************************** ***************
Provided By : eSignal. (c) Copyright 2003
Jason K. posted this info 7/18/03:
File Name: BidAskVolume.efs
Description:
Tracks volume traded at the Bid, Ask and inside the bid/ask spread. Displays the volume in three histograms,
green (ask), black (inside), and red (bid).
Formula Parameters:
None.
Notes:
When the formula is first applied to the chart, there will not be any volume information displayed. The formula will
then begin collecting data as trades occur and display the data in real time going forward.
################## My Notes ################
crjaq1 posted this request on 4/7/04:
How can I merge all three types of data in the BID/ASKVOLUME.EFS study to form a total sum value: line chart per
one minute interval? Can someone edit the code in order to make this plot. Or is there something similar?
THANKS
************************************************** ***************/
function preMain() {
/*************************************
setStudyTitle("Bid\/Ask Volume");
setCursorLabelName("Ask Vol", 0);
setCursorLabelName("Inside Vol", 1);
setCursorLabelName("Bid Vol", 2);
setDefaultBarFgColor(Color.green, 0);
setDefaultBarFgColor(Color.black, 1);
setDefaultBarFgColor(Color.red, 2);
setDefaultBarThickness(8, 0);
setDefaultBarThickness(6, 1);
setDefaultBarThickness(4, 2);
setPlotType(PLOTTYPE_HISTOGRAM, 0);
setPlotType(PLOTTYPE_HISTOGRAM, 1);
setPlotType(PLOTTYPE_HISTOGRAM, 2);
*****************************************/
//Added the following 4 lines
setStudyTitle("Bid\/Ask Volume Total");
setCursorLabelName("BidAskInside", 0);
setPlotType(PLOTTYPE_HISTOGRAM, 0);
setDefaultBarFgColor(Color.black, 0);
}
var nBidVol = 0;
var nInsideVol = 0;
var nAskVol = 0;
var vVol = null;
var bPrimed = false;
function main() {
if (getCurrentBarIndex() < 0) return;
var nState = getBarState();
if (nState == BARSTATE_NEWBAR) {
// nBidVol = 0;
nInsideVol = 0;
// nAskVol = 0;
vVol = 0;
}
var vPrevVol = null;
if (vVol != null && bPrimed == true) vPrevVol = vVol;
var nAsk = getMostRecentAsk();
var nBid = getMostRecentBid();
var vClose = close();
vVol = volume();
var vTradeVol = vVol - vPrevVol;
if (bPrimed == false && vVol != null) {
bPrimed = true;
return;
} else {
if (vClose <= nBid) {
nBidVol += vTradeVol;
} else if (vClose >= nAsk) {
nAskVol += vTradeVol;
} else {
nInsideVol += vTradeVol;
}
}
//Added the following two lines
var vTotal = nAskVol - nBidVol ;
return vTotal;
//return new Array(nAskVol, nInsideVol, nBidVol);
}
/************************************************** ***************
Provided By : eSignal. (c) Copyright 2003
Jason K. posted this info 7/18/03:
File Name: BidAskVolume.efs
Description:
Tracks volume traded at the Bid, Ask and inside the bid/ask spread. Displays the volume in three histograms,
green (ask), black (inside), and red (bid).
Formula Parameters:
None.
Notes:
When the formula is first applied to the chart, there will not be any volume information displayed. The formula will
then begin collecting data as trades occur and display the data in real time going forward.
################## My Notes ################
crjaq1 posted this request on 4/7/04:
How can I merge all three types of data in the BID/ASKVOLUME.EFS study to form a total sum value: line chart per
one minute interval? Can someone edit the code in order to make this plot. Or is there something similar?
THANKS
************************************************** ***************/
function preMain() {
/*************************************
setStudyTitle("Bid\/Ask Volume");
setCursorLabelName("Ask Vol", 0);
setCursorLabelName("Inside Vol", 1);
setCursorLabelName("Bid Vol", 2);
setDefaultBarFgColor(Color.green, 0);
setDefaultBarFgColor(Color.black, 1);
setDefaultBarFgColor(Color.red, 2);
setDefaultBarThickness(8, 0);
setDefaultBarThickness(6, 1);
setDefaultBarThickness(4, 2);
setPlotType(PLOTTYPE_HISTOGRAM, 0);
setPlotType(PLOTTYPE_HISTOGRAM, 1);
setPlotType(PLOTTYPE_HISTOGRAM, 2);
*****************************************/
//Added the following 4 lines
setStudyTitle("Bid\/Ask Volume Total");
setCursorLabelName("BidAskInside", 0);
setPlotType(PLOTTYPE_HISTOGRAM, 0);
setDefaultBarFgColor(Color.black, 0);
}
var nBidVol = 0;
var nInsideVol = 0;
var nAskVol = 0;
var vVol = null;
var bPrimed = false;
function main() {
if (getCurrentBarIndex() < 0) return;
var nState = getBarState();
if (nState == BARSTATE_NEWBAR) {
// nBidVol = 0;
nInsideVol = 0;
// nAskVol = 0;
vVol = 0;
}
var vPrevVol = null;
if (vVol != null && bPrimed == true) vPrevVol = vVol;
var nAsk = getMostRecentAsk();
var nBid = getMostRecentBid();
var vClose = close();
vVol = volume();
var vTradeVol = vVol - vPrevVol;
if (bPrimed == false && vVol != null) {
bPrimed = true;
return;
} else {
if (vClose <= nBid) {
nBidVol += vTradeVol;
} else if (vClose >= nAsk) {
nAskVol += vTradeVol;
} else {
nInsideVol += vTradeVol;
}
}
//Added the following two lines
var vTotal = nAskVol - nBidVol ;
return vTotal;
//return new Array(nAskVol, nInsideVol, nBidVol);
}
Comment