PDA

View Full Version : Divergence spotter


sbgtrading
11-20-2007, 07:17 AM
This indicator finds divergences between indicators and price.

If anyone has a more efficient algorithm, feel free to share!

Ben

ale la juve ale
12-12-2007, 05:04 PM
Hi,

I was wondering how to remove this indicator that I just downloaded.

I downloaded by using import ninjascript. When I try removing it using: remove ninja script it doesn't appear in the selection Box.

randyjb
12-12-2007, 07:02 PM
Hi Joe... you should be able to open your Control Center, left click on Tools, left click on Edit Ninjascript, left click on Indicator... then a boxed listing of your indicators should pop up. Go to DivergenceSpotter and left click it once to highlight it.. then go down and click Delete down below that area and that should take care of your issue.

Happy Trading,
Randy

Pete S
12-14-2007, 09:12 AM
Thanks for posting! I have been thinking about doing something like this myself...I will spend some time going through it and see if I have any feedback.

Pete

Elliott Wave
04-04-2008, 11:49 PM
This is a great indicator, one of my favorites.

Thanks for creating it.

:)

sbgtrading
04-05-2008, 08:36 AM
Thanks for the feedback! I'm glad you're finding it valuable. Feel free to share your usage techniques.

Ben

Elliott Wave
04-05-2008, 02:20 PM
I liked it so much it I even opened it up in the script editor, which was a first for me.

I added the TRIX indicator which is one of my favorites, and it actually works!;)

That got me thinking of trying to make it allow any indicator, by doing something like:

TheIndicator.Set(indicatorType(fastPeriod)[0])

Rather than specifically defining each one. The indicator list will be right there so it should be easy to type the correct name.

The downside it that it might not always work as expected, but there could be some surprising uses. One hurtle I can think of is determining the number of variables each indicator uses. I assume there would be an error when trying to feed two variables to an indicator that uses one and vice versa.


As for usage, I like to use the MACD, Money Flow and TRIX with longer periods than normal, sometimes simultaneously with different line types colors and sizes etc. I'm still playing around with it though and don't use it as much for decision making as I do to alert me a decision might need to be made...

:)

Aussie2
04-05-2008, 04:19 PM
Very nice. Like it. Will explore.

vast524
05-06-2008, 05:31 AM
I am wondering if someone could explain how this indicator works please.
I am not quite sure how it works. I am sorry if this appears a dumb question.
I see the little pink dots forming on the chart and the value of the current dot on the price bar.
How does it show a divergence?
Regards

sbgtrading
05-06-2008, 06:17 AM
Hello,
The dots are an indication that a divergence is occuring between price and an oscillator or indicator. For instance, when prices push lower and the indicator moves higher, the dots will start to form above the price bars. The dots are a quick way to tell if price and the indicator are moving in different directions.

Ben


I am wondering if someone could explain how this indicator works please.
I am not quite sure how it works. I am sorry if this appears a dumb question.
I see the little pink dots forming on the chart and the value of the current dot on the price bar.
How does it show a divergence?
Regards

vast524
05-08-2008, 06:27 AM
Thanks Ben
I still am a little vague though. (Won't be the first time either)
Which indicator does work with ? I noticed that it is linked with the MACD
I guess if the dots are forming under the candle then it means the price may drop.
I noticed that the dot has a pink arrow on the price . Does this indicate a possible price?
Regards

sbgtrading
05-08-2008, 06:41 AM
Here's the indicators you can select (taken from my website):
This indicator helps keep an eye on buy/sell divergence between price and a user selectable indicator (MACD, FastStoch, StochRSI, CCI, BOP, CMO, Chaikin MoneyFlow, Momentum, MoneyFlow, RSI, ROC

I'm not sure what you mean about the "pink arrow on price" but I will tell you this, the actual price values of the dots that plot is not important. I've just plotted the dots near the current price bars so you can easily see the dots (the indication of divergence occurring)...if I had plotted them far away from price action, one might not be aware of them.

Does that answer your question?

Ben

Thanks Ben
I still am a little vague though. (Wont be the first time either)
Which indicator does work with ? I noticed that it is linked with the MACD
I guess if the dots are forming under the candle then it means the price may drop.
I noticed that the dot has a pink arrow on the price . Does this indicate a possible price?
Regards

jonesenberg
05-12-2008, 10:03 AM
This one is just fantastic. Question: How would one go about including OBV as a supported indicator from which to spot divergences?

Elliott Wave
05-12-2008, 12:19 PM
Its not too hard.

Basically just use the existing code as a guide and put OBV in place of one of the other indicator names...

I'm greatly looking forward to NT7 when hopefully all this is in the past and we can simply select the input series for indicators just as we already can with strategies.

sbgtrading
05-12-2008, 09:47 PM
Hello Jonesenberg...glad you like it!

Adding OBV would be a little difficult...since it's not an oscillator. The problem is DivergenceSpotter looks for sell divergence when the indicator is above its zero line and divergence occurs. It looks for buy divergence when the indicator is below its zero line and divergence occurs.

What we may be able to do is "normalize" OBV by using a moving average of OBV as its zero line. But, the results may be unpredictable/unreliable for trading signals.

In either case, let me tinker with it an see what will happen.

Ben

This one is just fantastic. Question: How would one go about including OBV as a supported indicator from which to spot divergences?

jonesenberg
05-13-2008, 06:13 AM
Hmm... Perhaps it could be set up so that if price is higher n bars ago and OBV is lower n bars ago, a dot appears below the candle and vice versa. With this type of setup it might be useful to run multiple instances of this indicator with different lookbacks to determine when price and OBV are divergent across the long, intermediate, and shorter timeframes. I've also pondered this type of indicator tied to a zigzag-type line, so that when say a 5% zig in price is compared to the same period for the indicator, divergences could be spotted be measuring the degree (or slope, or linear regression line) of the indicator during that period vs. price itself. Who knows, maybe even divergences could be color coded across a spectrum from green to red so that one could clearly see the severity of the divergences at a glance.

I'm thinking out loud of course.

In any case, I find that using DivergenceSpotter with two price momentum indicators and one volume indicator prove quite helpful.

Thanks again

sbgtrading
05-13-2008, 06:45 AM
Or, alternatively, you could calculate a Stochastic of the OBV line and use that oscillator in the DivergenceSpotter code. I've done this with the A/D line before.


Hmm... Perhaps it could be set up so that if price is higher n bars ago and OBV is lower n bars ago, a dot appears below the candle and vice versa. With this type of setup it might be useful to run multiple instances of this indicator with different lookbacks to determine when price and OBV are divergent across the long, intermediate, and shorter timeframes. I've also pondered this type of indicator tied to a zigzag-type line, so that when say a 5% zig in price is compared to the same period for the indicator, divergences could be spotted be measuring the degree (or slope, or linear regression line) of the indicator during that period vs. price itself. Who knows, maybe even divergences could be color coded across a spectrum from green to red so that one could clearly see the severity of the divergences at a glance.

I'm thinking out loud of course.

In any case, I find that using DivergenceSpotter with two price momentum indicators and one volume indicator prove quite helpful.

Thanks again

John_Aus
05-14-2008, 07:14 AM
What would be the settings for a 14 CCI?

lks8d9f7j4fsdf
07-18-2008, 09:26 AM
Hi,

Has anyone managed to add an audible alert to this indicator?

If so, would they care to share? :)

tomydispik
08-07-2008, 06:49 PM
How do I import this divergance spotter into the program? Tried damn near everything to make it import and it doesnt seem to want to.

sbgtrading
08-07-2008, 07:50 PM
How do I import this divergance spotter into the program? Tried damn near everything to make it import and it doesnt seem to want to.


Hi Tomy,
What error message shows up when you try it? There may be a problem with some existing indicator on your platform that is causing the error and interfering with the import.

tomydispik
08-07-2008, 09:29 PM
No error actually, I just cant see it in the menu when I go to use it

Hi Tomy,
What error message shows up when you try it? There may be a problem with some existing indicator on your platform that is causing the error and interfering with the import.

KBJ
08-09-2008, 08:09 PM
After you load the source for an indicator onto your disk you have to compile the source before it will show up in the list of indicators that you can add to a chart.

Therefore, go to Tools/Edit NinjaScript/Indicators and open any indicator you see listed and press F5 to compile it.

Then you can close the indicator source editor and add whatever new indicators you've downloaded (and now compiled) to your charts.

scyche
07-14-2009, 04:18 PM
Would anybody please tell me how to use this indicator to create a strategy? In the equation, what should I enter on the right side if I want to use it as a buy signal?

Thank you!

sbgtrading
07-14-2009, 04:57 PM
Would anybody please tell me how to use this indicator to create a strategy? In the equation, what should I enter on the right side if I want to use it as a buy signal?

Hello Syche,

Here's an example:

double sig = DivergenceSpotter(3, DivergenceSpotter_IndicatorType.RSI, 0, 14, 1, 0).Plot0[0];

if(sig > Close[0]) {
//valid buy signal generated
}
if(sig < Close[0]) {
//valid sell signal generated
}

Ben

scyche
07-14-2009, 05:10 PM
Thank you very much for your reply.

But I did not find any "BuySignal" or "SellSignal" in the indicator. Can I use it directly?


Hello Syche,

Here's an example:

double buysig = DivergenceSpotter(3,DivergenceSpotter_IndicatorTyp e.RSI, 0, 14, 1, 0).BuySignal[0];
double sellsig = DivergenceSpotter(3,DivergenceSpotter_IndicatorTyp e.RSI, 0, 14, 1, 0).SellSignal[0];
if(buysig != Close[0]) {
//valid buy signal generated
}
if(sellsig != Close[0]) {
//valid sell signal generated
}

Ben

sbgtrading
07-14-2009, 05:34 PM
But I did not find any "BuySignal" or "SellSignal" in the indicator. Can I use it directly?


My apologies...I changed the code snippet to reflect the DivergenceSpotter which was posted to this thread in Post 1. The "BuySignal" and "SellSignal" are not in the DivergenceSpotter code as posted.

sbgtrading
07-14-2009, 05:35 PM
Also...you may consider viewing (and using) the indicator that's been posted to another thread...that indicator is called "D3Spotter".

It appears to be an enhanced version of the DivergenceSpotter.

Search the NinjaScript files section for "d3spotter"

scyche
07-14-2009, 08:25 PM
Thank you very much for your help!

isitpossible
07-29-2009, 08:48 PM
Check here.... (http://www.ninjatrader-support2.com/vb/local_links.php?catid=2)

I hope this works for you..... good luck!

Parv8
07-31-2009, 10:08 PM
Thanks isitpossible. Backtesting results seems to be great even on 15mins charts. Keep up the good work.:)

dax326
08-22-2009, 11:33 AM
Thanks isitpossible. Backtesting results seems to be great even on 15mins charts. Keep up the good work.:)

I am trying to utilize the D3Spotter in a strategy I am creating using the wizard (not a programmer). Can anyone advise as to how to set this up so that it will consider the condition to be true in my strategy. (a screen shot would be awsome)

Thanks in advance..

NinjaTrader_Ben
08-22-2009, 01:51 PM
Hello,

We can help you with any default indicators.

tomydispik
08-31-2009, 06:57 PM
Hello,

We can help you with any default indicators.


OK NTBen...I am starting to really rely on this indicator. A couple questions though:

What indicators are being used by this indicator? Are they triggered by me opening them in the trading pane or are they running "behind the scenes"?

What significance do the red arrows play?

tomydispik
09-13-2009, 05:23 PM
Hello Ben.

I have been using your D3Spotter for a few weeks now and am starting to dial into how to use it effectively but I still have some questions.

You had mentioned in the chat thread that this indicator detects divergence between price and other indicatiors (wew both know the list). Do these indicators need to be open for D3 to use them or do they run in the background?

What do the yellow dots indicate?

What do the arrows indicate?

sbgtrading
09-13-2009, 06:14 PM
Hi Tomy,

Thanks for the email...but unfortunately there's a misunderstanding about who is the author of this indicator. It wasn't me...it's a good indicator, but I can't take credit for it. I don't remember who did create it, but I'm sure the Forum can help you find the source.

Thanks again,
Ben


Hello Ben.

I have been using your D3Spotter for a few weeks now and am starting to dial into how to use it effectively but I still have some questions.

You had mentioned in the chat thread that this indicator detects divergence between price and other indicatiors (wew both know the list). Do these indicators need to be open for D3 to use them or do they run in the background?

What do the yellow dots indicate?

What do the arrows indicate?

NinjaTrader_Ben
09-13-2009, 10:57 PM
tomy,

This is not an indicator that I can assist you with, sorry about that. This is a custom indicator and I can only assist you with the default indicators. Someone else on this thread might help you though.

price777999
03-03-2012, 07:01 AM
Does this work on Ninja 7 ?