NeoTicker Forums  

Go Back   NeoTicker Forums > Trading Related > Indicator/Trading System Sharing

Reply
 
Thread Tools Rating: Thread Rating: 60 votes, 5.00 average. Display Modes
  #1  
Old 01-19-2006, 10:24 PM
barchart
Guest
 
Posts: n/a
bid/ask volume ratio indicator

Does anybody know how to build bid/ask volume ratio indicator?

I sent request to NeoTicker support and got no answer. I emailed to one member of this forum and got an unfriendly response "read help." Well, if I was able to find it in the help section I would not send emails to others. My last resort is to start a new thread. Can anybody help or at least give a hint how to approach this?

What do I need?
Divide volume at bid by volume at ask and show it as a histogram under OHLC barchart. Your help will be greatly appreciated. Thanks in advance.
Reply With Quote
  #2  
Old 01-20-2006, 10:04 PM
tazman's Avatar
tazman tazman is offline
Regular User
 
Join Date: Jan 2006
Location: Atlanta, GA
Posts: 54
Bid/Ask Volume Ratio Indicator

Hi barchart,

I think the strength of the forum is the synergy created when we are able to learn from each other. If you are willing to take an active roll in the development of this indicator and post our progress for the forum users, I will do my best to help you. The intention would be two fold. Create an indicator forum users can use and critique. Secondly, help you learn the necessary skills to create this indicator and in turn be able to help the next person.

When people share information on the forum they many times get requests for help from other users. Unless they feel the person requesting help is interested in learning and sharing I have found they will not enthusiastically take time away from their personal priorities to help. This is only natural.

I am not sure what level of experience you have writing code. Please post your response if you are interested in working on this project as well as an indication of your current experience. Your post does not establish whether you need help specific to this indicator or to creating indicators in general.

Regards,
tazman
Reply With Quote
  #3  
Old 01-21-2006, 11:30 AM
LizardHead LizardHead is offline
Regular User
 
Join Date: Sep 2003
Posts: 95
You want the "TP BidAskTradeVolN" indicator. Set up parameters so Style = "All Tick", Break Style = "Bar Change". Then set the plot type to histogram. You then will have to use the tick replay feature in order to get some values for the existing bars on chart. Go to Chart Manager, "Misc" tab. I usually only replay the last 1-2 days. See "Tick Precise Indicators" in help. It sounds more complicated than it really is . Once you get the hang of them, the TP indicators are very powerful.
Reply With Quote
  #4  
Old 02-01-2006, 03:50 PM
wrines wrines is offline
Regular User
 
Join Date: Jan 2006
Posts: 31
I found it -sort of-

Well,
I did find an eSignal study (whih is based on Javascript) for bid/ask volume ratio, but when I applied it in NT (it imports fine and verifies fine if you set language to Javascript) and place it in a pane and base it on a data series I get a histogram that looks like just the TOTAL # of contract volume (all above zero), so something isnt right - of course it should show volume above 0 in blue as ask volume and volume below zero in red as bid volume I believe. Can anyone here tell me what the problem might be? Thanks! Here is the code:


function preMain() {
setStudyTitle("Bid\/Ask Volume Ratio ");
setCursorLabelName("Vol Ratio", 0);
setDefaultBarThickness(1, 0);
setPlotType(PLOTTYPE_INSTANTCOLORLINE, 0);

var fp1 = new FunctionParameter("sSource", FunctionParameter.STRING);
fp1.setName("Ratio Option");
fp1.addOption("Bid/Ask");
fp1.addOption("Ask/Bid");
fp1.addOption("Bid-Ask");
fp1.addOption("Ask-Bid");
fp1.setDefault("Bid/Ask");
}

var nBidVol = 0;
var nAskVol = 0;
var vVol = null;
var bPrimed = false;
var vColor = null;
var bEdit = true;
var nBase = 0;

function main(sSource) {
if (getCurrentBarIndex() < 0) return;

if (bEdit == true) {
if (sSource == "Bid/Ask" || sSource == "Ask/Bid") {
nBase = 1;
} else {
nBase = 0;
}
addBand(nBase, PS_SOLID, 1, Color.black, "base");
}

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;
}
}

var nRatio = 1;

switch (sSource) {
case "Bid/Ask" :
if (nAskVol > 0) nRatio = nBidVol/nAskVol;
break;
case "Ask/Bid" :
if (nBidVol > 0) nRatio = nAskVol/nBidVol;
break;
case "Bid-Ask" :
Reset();
nRatio = nBidVol-nAskVol;
break;
case "Ask-Bid" :
Reset();
nRatio = nAskVol-nBidVol;
break;
}

if (nRatio >= nBase) {
vColor = Color.blue;
} else if (nRatio < nBase) {
vColor = Color.red;
}

if (vColor != null) setBarFgColor(vColor);

return nRatio;
}


function Reset() {
var nState = getBarState();
if (nState == BARSTATE_NEWBAR) {
nBidVol = 0;
nAskVol = 0;
vVol = 0;
}
}
Reply With Quote
  #5  
Old 02-01-2006, 08:33 PM
Lawrence Chan Lawrence Chan is offline
Moderator
 
Join Date: Sep 2003
Posts: 2,661
I think the word java confused you that the eSignal efs is compatible with NeoTicker.

Unluckily thats not true.

eSignal has its own indicator architecture, and object/language extension to Java that cannot be recognized by NeoTicker.
Reply With Quote
  #6  
Old 02-02-2006, 10:53 AM
wrines wrines is offline
Regular User
 
Join Date: Jan 2006
Posts: 31
thanks but...

Thanks for the reply, Mr Chan, but since now two users have requested it, rather than just saying the languages of TS EasyLanguage and eSignal EFS are not the same as NeoTicker scripting language, could you possibly please just help write a NeoTicker version of the bid/ask volume ratio indicator? Thanks!
W
Reply With Quote
  #7  
Old 02-02-2006, 12:03 PM
Merlin Merlin is offline
Regular User
 
Join Date: Dec 2005
Posts: 202
Mr. W,

Lizardhead has already answered your question up above. The TPBidAskTradeVolN indicator will do *exactly* what you are asking for, when set up as he suggests. He's told you everything you need to run it. There's no need to ask for code for the indicator, because the indicator you're asking for is already built-in to NeoTicker.

By the way, the only "rude" comments I see in this thread are yours. The information you need is in the help files. If reading them is too much effort for you, I suspect you're in the wrong place.

Merlin
Reply With Quote
  #8  
Old 02-04-2006, 09:34 AM
Lawrence Chan Lawrence Chan is offline
Moderator
 
Join Date: Sep 2003
Posts: 2,661
My next blog article will be on basic techniques for writing TP indicators.

It will be useful for everyone who is interested in analyzing intra-tick information.
Reply With Quote
  #9  
Old 02-04-2006, 03:46 PM
wrines wrines is offline
Regular User
 
Join Date: Jan 2006
Posts: 31
when?

Thank you Mr. Chan.
Is there any way to know when that article will be published?

W
Reply With Quote
  #10  
Old 02-07-2006, 09:26 AM
Lawrence Chan Lawrence Chan is offline
Moderator
 
Join Date: Sep 2003
Posts: 2,661
Its done.

Visit the blog site to check it out,
http://newsletter.neoticker.com/?p=170
Reply With Quote
  #11  
Old 02-07-2006, 11:08 AM
wrines wrines is offline
Regular User
 
Join Date: Jan 2006
Posts: 31
thanks

thank you very much Mr Chan - great work!
W
Reply With Quote
  #12  
Old 04-06-2007, 04:23 PM
nelo nelo is offline
Regular User
 
Join Date: Nov 2006
Posts: 19
Lizardhead, Merlin, Barchart,

the TPBidAskTradeVolN IS NOT what Barchart asked for. He said "ratio" and "divide volume". Do not confuse *subtraction* operation with *division*, that makes vital difference. As far as I know there is no built-in indicator doing end of bar (or n-tick) tick volume division in neoticker.

Example: TPBidAskTradeVolN result is e.g. 14, it can mean 414 contracts versus 400 - what means quite even powers but also 44 and 30 what is completely different. With ratio based indicator you would see 1.035 in the first case but 1.47.

One way is to write an TP indicator based on Lawrence article (thanks Lawrence, great).

Other way is easier at least in this case. You need three indicators: TPBidAskTradeVolN (set up as you guys suggested), Volume indicator and formula2 indicator with those two inputs.
Actually, I give you two formulas (none of them is checking for zero division, this last task I leave on you to improve your skills):

1/ standard way
if(data1>0,(data2+data1)/(data2-data1)-1,1-(data2-data1)/(data2+data1))

2/ log normal way
ln((data2+data1)/(data2-data1))

I do not claim that division based tick precise indicator is better than subtraction based, just the math should be clear. Try and choose what suits your objective better.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:51 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyrightę 2000-2010 TickQuest, Inc.