View Full Version : Idea for a new indicator
Antraman
11-16-2005, 08:06 PM
Hi there,
Have been playing around with NT5 charting tools, what an addition to NT5! Awesome.
Anyway, I have an idea for an indicator that you guys might want to build into a future version. Its something I have been using when looking for entry points in share trading, and that is calculating the number of bids to a certain depth, and the number of asks to a certain number of levels of depth, and weighing one against the other in an effort to forecast future short term price movements. As we all probably know, more bids (buyers) pushes the price up, and more asks (sellers), pushes the price down.
By totalling the number of bids against asks, it is possible to foretell which direction the next sale will turn, therefore making it a bit easier to a) pick a finely tuned entry point, and b) have an idea of whether the market will go long or short.
It has been pretty successful for me with shares, as it is a slower market - the numbers of bids and asks in a stock's market depth chart change pretty slowly and I can calculate these pretty quickly in my head, but with the futures the numbers of bids and asks changes very rapidly, making it next to impossible to make such calculations mentally.
I see on the SuperDOM that bids and asks are shown to a depth of 5 levels, how difficult would it be to have these figures filtered into a program that weighs each up against the other and outputs a +/- figure, indicating a possible future long or short trend?
Anyone got any throughts on this?
cheers,
NinjaTrader_Ray
11-16-2005, 08:48 PM
I think it was NTV2 that had a depth meter on the SuperDOM that did exactly as you described below. It was not that successful in that not a lot of people incorporated it into their trading.
I have been thinking about adding the CVD (Cumulative Volume Delta)indicator which is in my mind a better volume based indicator than OBV. What it does it plot the differnce between volume trading at the ask vs trading at the bid. It does this using one level of course.
Ray
Antraman
11-17-2005, 03:04 AM
Interesting. What a shame I missed it.
The CVD does sound very similar to what I am thinking of. I might check it out.
Antraman
03-12-2006, 01:57 PM
Been checking out the CVD (Cumulative Volume Delta) and while it at first seems similar to what I was asking about in post below, it is a bit different.
CVD appears to measure the volume of TRADED bids and asks, which means it's a lagging indicator. I was really looking for something that looked a bit more to the future, something that weighs the current bid and ask orders already placed, but not yet traded. CVD uses only 1 level of depth, as it is recording actual trades, however, I believe that the 2 and subsequent levels also have an influence on actual price movement, and also orders can be cancelled anytime after they are placed and before they are executed, so the trading environment is changing all the time. It is this environment that I am hoping to record with an indicator.
My suggestion (please excuse me, I haven't put a *lot* of thought into this) on how it could work is like this:
You have a horizontal zero line, with a label "O". On the vertical axis above the zero line would be no.# of asks, and below the zero line no.# of bids.
In the indicator options, you could select the depth (from the last traded price level) that you wish to measure, being anything between 1-5 (which is the number of levels that depth is shown in figures on the DOM).
Then a negative value could be applied to asks, and a positive value applied to bids, and the bids and asks are then added, to give a +/- figure. This figure would relate to bid/ask power, which could be represented by a signal line which could trace over the zero line, moving above or below to the extent of the difference between bids/asks (power). When the total of bids is greater than the total of asks, it will give a positive value, and vice versa.
The vertical axis would then have an incremental negative number scale under the zero and a positive incremental scale above the zero, which gives a readout of the quantity of the difference between total bids and total asks, so it would appear as in the attached graphic below...
To add detail, you could have a separate line for each level of depth, and have all 5 levels shown if you wanted, and each line can be edited to a different colour representing closeness to the traded price. Each level of depth could calculated separately, so you get a separate readout for each level.
You could take your data from the script that creates the text for the figures of cumulative depth in the DOM.
Does anyone think this is a worthwhile indicator to create? IS it possible to do in Create New Indicator Wizard?
cheers,
Antraman
03-12-2006, 02:42 PM
This is the sort of thing I am thinking about...
http://www.nielsenindicator.com/
Besides the complexity of guessing if bids/offers are real or simply meant to "spook" the market, how is this different than Money Flow? Or combining Money Flow with OBV?
Antraman
03-13-2006, 02:33 AM
I don't know much about Money Flow or OBV indicators as I have not studied them yet, so can't answer that part of the question.
I see no "guessing involved in knowing whether bids/asks are real or not" - trades are put on and cancelled all the time, and the cumulative depth shows the number of bids/asks at any one point in time. The numbers change over time, and as they get closer to the price action, the more definite the figures become, to the point that they are actually traded and one knows exactly how many trades were executed at that price. The disparity between the numbers of bids and asks at level one depth determine where the next movement will go in order to satisfy the filling of orders.
This I think is covered by the initial posts on another thread http://ninjatrader.mywowbb.com/forum5/681.html
As I said, this method has worked pretty well for me in share trading, as the change in number of orders is quite slow, and I can compute the weight of bids against asks mentally, and can observe and generally predict small movements in the price action as a result of these varying bids and asks (as the Nielsen Indicator shows), so I believe there is a logic behind it, but in futures the changes in orders is too rapid for me to compute mentally hence my desire for a CPU to help me.
I also mentioned that it is really only to try and predict very small changes in price, for when one wishes to fine tune their entry point, not as an indicator of large, general trends. I think that has some bearing on the issue.
If you think its a load of dingoes kidneys, then please explain why...I don't see how your final comments in the above mentioned thread relate to my initial question or to Underground's question in that thread.
cheers,
I dont have any problem with any indicator. I'm also happy to deploy capital to capture bid/offer spreads - if your idea helps me do this, thanks!
My question stems from orders I can place that reside on my PC, or broker server, and show say 100 shares on an ECN order book, while my true amount may be significantly in excess of 100. So, while your indicator sees my 100 shares if you bid the market as per your indicator, my selling increases - although you only see 100 shares. This is common in various arb strategies.
Which exchange are you using your idea on?
Antraman
03-13-2006, 10:13 AM
I've been trading for a few years on the ASX through the Commsec and Westpac Broking online interfaces. I am presently studying and running sim in the Euro/USD futures with a plan to switch over soon.
I realise there are orders on the ASX and other exchanges whose quantities are undisclosed, I am still trying work out what goes on with that...and I realise this fact will confound the bid/ask market depth to a certain extent. Does this mean that the CVD will not display trades of orders with undisclosed quantities?
On the Commsec interface, any orders of undisclosed quantity are indicated by a "/u" in the market depth ladder, and they are very rare...
What are arb strategies?
cheers,
Antraman
03-13-2006, 10:13 AM
double post - sorry
Undisclosed orders, are also sometimes conditional orders, as in the order will activate only if the bid is a certain size, so it may wreck havoc with your plan. This is pretty common in NY as even retail brokers offer this.
Money Flow will show you if money is flowing in/out and may be an indicator you're interested in.
arb=arbitrage
buderim
08-13-2007, 04:09 AM
I think it was NTV2 that had a depth meter on the SuperDOM that did exactly as you described below. It was not that successful in that not a lot of people incorporated it into their trading.
I have been thinking about adding the CVD (Cumulative Volume Delta)indicator which is in my mind a better volume based indicator than OBV. What it does it plot the differnce between volume trading at the ask vs trading at the bid. It does this using one level of course.
Ray
Hi ,
Did the delta indicator ever get made ?
Ian
NinjaTrader_Ray
08-13-2007, 07:32 AM
Please take a look at some of the BuySellVolume indicators, this may be of value. CVD has not been implemented.
rally
08-14-2007, 07:43 PM
Hi Ray,
I tried the BuySellVolume and BuySellPressure indicators, but nothing is showing, just blank panels, do these indicators work only in the live version of NT?
rally
08-14-2007, 08:04 PM
Hi Antraman,
I like your idea, take a look at the flash demo on the left hand side of this:
http://www.tradingtechnologies.com/xtrader-pro.aspx
I'm very surprised CVD has not been implemented in NT. Also does NT have any plans to implement the other 2 volume indicators below the CVD in the above demo video?
NinjaTrader_Ray
08-15-2007, 07:39 AM
It only works in real-time.
rally
08-15-2007, 07:41 AM
Thanks Ray, is there anyway of saving all that data, because everytime I switch timeframes I lose all the data?
And also does this mean if I need that data I will need multiple charts open just that I can collect that data?
NinjaTrader_Ray
08-15-2007, 07:46 AM
Unfortunately not at this time since we do not have an internal mechanism to store bid/ask data at the tick level.
rally
08-15-2007, 07:51 AM
Thanks, when will you be bringing back the CVD indicator?
This is odd, everytime you remove another indicator, you lose the data:(
NinjaTrader_Ray
08-15-2007, 07:56 AM
Its on our list for future consideration.
Everytime you change the indicators on a chart, all indicators are reset internally, this is why you lose the data. Set up the chart the way you want, add the BuySellVolume indicators, and leave the chart alone after that.
rally
08-15-2007, 07:59 AM
Thanks.
Really appreciate it if you guys can speed up the CVD indicator :)
Learning1
08-15-2007, 09:21 AM
Thanks for the interesting thread. I was thinking of an indicator along the same lines and UACVAX kindly coded an indicator that sums the level 1 bid or ask or last through the course of a bars formation. The link is here http://www.ninjatrader-support.com/vb/showthread.php?t=2864&highlight=cumulative and I have attched the indicator which is Called CumulativeCurrentVolume.
Yesterday I took a shot at converting this into an indicator that will make a ratio bid/ask and a couple of Moving Averages of this ratio. Unfortunately, I ran into a challenge with my NinjaScript skills and I get a compiling error that I have not been able to figure my way around. If someone wants to take a peek at the attached code, we may have an indicator that partially mimics the Smart Money indicator descibed in one of the previous links.
The limitation that it would have is that each second it is adding the current bid (Level 1) to a running total for the bar (Same with current ask). It is not taking into account the entire Cumulative Level 2 Depth that is seen in the DOM. The Dom Sums the Bid / Ask Volume, but it seems this number is not currently available in NinjaScript.
Learning1
08-15-2007, 01:14 PM
I Worked on this indicator and made some progress, but I am getting the following error message that I can't seem to get past: " Operator '/' cannot be applied to operands of type 'CumulativeVolume' and 'CumulativeVolume' Indicator\gpPressure.cs 55
The two Cumulative volume references in the error come from the following code:
Pressure.Set(CumulativeVolume.Bid / CumulativeVolume.Ask);
Does anyone have suggestions?
NinjaTrader_Ray
08-15-2007, 02:14 PM
You are trying to divide an indicator object by another indicator object instead of its values.
You need to reference a value at a specific bar within the indicator.
Such as :
Set(SMA(20)[0] / SMA(40)[0]);
Learning1
08-15-2007, 02:38 PM
If I reference the value of each object in the current bar,
Pressure.Set(CumulativeVolume.Bid[0] / CumulativeVolume.Ask[0]);
I get the following error instead:
Cannot apply indexing with [] to an expression of type 'CumulativeVolume' Indicator\gpPressure.cs 55
Do I need to assign the value of the CumulativeVolume.Bid object into a new dataSeries (Same with Ask), and then Divide the two data series?
NinjaTrader_Ray
08-15-2007, 02:46 PM
I have not been following this thread intimately so I don't exactly know what CummulativeVolume is.
Ultimately, you need to divide two double values.
Set(double value / double value);
Therefore, if there are values contained in the CummulativeValue object, get those, make sure they are double values and then divide them.
There are many ways to do that, you don't need to store values in a DataSeries object unless you have a requirement to retrieve historical values.
NinjaTrader_Josh
08-15-2007, 02:54 PM
CumulativeVolume was a quick custom indicator I made for Learning1 in this thread http://www.ninjatrader-support.com/vb/showthread.php?t=2864. It just adds up the current volumes of the bid/ask/last of the current bar and resets itself at the start of every new bar.
To do the operation you want Learning1 try something like this:
CumulativeCurrentVolume(Input).VolType = CumulativeVolume.Bid;
double bidvolume = CumulativeCurrentVolume(Input)[0];
CumulativeCurrentVolume(Input).VolType = CumulativeVolume.Ask;
double askvolume = CumulativeCurrentVolume(Input)[0];
Pressure.Set(bidvolume/askvolume);I have not tested this code, but I believe it should work.
rally
08-15-2007, 06:35 PM
Please take a look at some of the BuySellVolume indicators, this may be of value. CVD has not been implemented.
Hi Ray,
Besides the BuySellVolume and BuySellPressure indicators, what other TT's volume based indicators are there in the current version of NT?
Also what is the BuySellPressure indicator known as in TT's X trader, only asking because i've been looking at the Volume indicators in TT.
NinjaTrader_Ray
08-15-2007, 07:17 PM
I am not familiar with any TT volume indicators. To see all of our available indicators you can press CTRL-I within a chart to open the Indicator dialog window.
Learning1
08-16-2007, 09:35 AM
Thanks uacvax, for both the original code and this snippet. W
hen I use this snippet, the code compiles, but the output is simply a line with all values at 1. It does not seem to be pulling the current values from the CumulativeCurrentVolume Indicator you authored. The Concept was to have a ratio of the Values generated by the CumulativeCurrentVolume(Bid) / CumulativeCurrentVolume(Ask) as a first step. Once this was working I was going to include the math to center it around 0 so that when BidVolume = AskVolume the indicator would be 0. When AskVolume > BidVolume indicator would be positive and when BidVolume > AskVolume, indicator would be negative. Do you have any ideas on why the code snippet would only return 1?
NinjaTrader_Josh
08-16-2007, 01:14 PM
Hi Learning1. I've been playing around with this all morning, but for some reason trying to change CumulativeCurrentVolume(Input).VolType twice doesn't seem to work. It does acknowledge that it has changed, but it only wants to call the CumulativeCurrentVolume indicator once with the first setting. This causes your ratio to be 1 because essentially you are dividing the bid by itself.
I couldn't figure out how to "fix" it in calling the indicators so I just modified CumulativeCurrentVolume to work around the issue. Install this version of CumulativeCurrentVolume and use this snippet instead.
bidvolume = CumulativeCurrentVolume(1)[0];
askvolume = CumulativeCurrentVolume(2)[0];
Pressure.Set(bidvolume/askvolume);0=last
1=bid
2=ask
Learning1
08-16-2007, 01:31 PM
Import Error,
For some reason I get an import error when I try to replace the exisiting indicator. The error says "there are NinaScript files in the imported NinjaScript archive file that have programming errors. These errors must be resolved before you can import the NinjaScript Archive File."
I've checked to ensure I don't have compiling errors in any other indicators or strategies and things seem OK. Odd ... Does it compile for you? Perhaps I should I open with a text editor and edit the current indicator manually?
By the way ... Thanks again.
Learning1
NinjaTrader_Josh
08-16-2007, 01:36 PM
I am theorizing that the problem is one of your indicators has references to the old style of calling CumulativeCurrentVolume. Try deleting all of those references before importing the new CumulativeCurrentVolume.
Learning1
08-16-2007, 01:38 PM
Probably True
Learning1
08-16-2007, 01:45 PM
That Worked - Good guess
mktrend
01-12-2009, 04:13 PM
any progress on the the CVD indicator?