the zip file you attached contains a bunch of indicators: 7 standard NT indicators plus Stoch_D_Color_Alert.cs and Stoch_K_Color_Alert.cs.
just to clarify... I assume you are concerned about the latter... right now the Stoch_K_Color_Alert.cs indicator paints the background in panel 2 (or wherever you designate) green when the %K goes above OBValue and orange when it goes below OSValue;
You want to have the background be green when %K rises above the OSValue and stay green until it drops down below the OBValue when it will turn red and vice versa so basically the background is always either green or red.
What if %K falls before it reaches the OBValue or turns up before it reaches the OSValue?
What if %K never reaches the OBValue... it will stay green until it crosses down through OSValue... even though that could be a lateral consolidation... is that what you want?
I think you need to specify all the various conditions to be sure of what you really want to see on the chart. Make a truth table so that your conditions are totally clear to you... then perhaps someone can do the coding for you.
Personally, I'd suggest you considerthe following:
- green when %K is above OBValue no matter whether rising or falling
- green when %K is above 50 and rising
- orange when %K is below OSValue no matter whether rising or falling
- orange when %K is below 50 and falling
- normal chart background otherwise
I would discourage you from using red as a background color unless you change rising/falling to white/black because the red line would disappear.
As far as using 70/30 instead of 80/20... that is already a setting in Stoch_K_Color_Alert.cs
Select level for coloring %K when between OSValue and OBValue depending on whether rising or falling
Select the background colors for %K conditions
Sound Alert On/Off Toggle
RodS, I have not tested the sound alerts although I added an On/Off toggle; also, this may not be exactly what you were thinking of but it is close... you need to think through the stochastic movement conditions that I mentioned in my earlier post. Enjoy!
By the way, the image shows a yellow trigger Stochastic (1,3,3) that I use for entering after a pullback.
To import this, save the zip file to your file system, then from the Control Center do: File / Utilities / Import NinjaScript; select the file you saved; select "Yes" for trusted; then when you see the "... already exists...", select "No" for replacing duplicates (they are standard NT indicators).
Last edited by Saroj; August 28th, 2009 at 09:40 AM.
Reason: Attaching image and NT import file
The following user says Thank You to Saroj for this post:
I am amazed at how fast some of you guys can code something. I'm so envious. I have no knowledge of your world at all and even though this isn't my thread, my hats off to all you who are computer language literate.
The following user says Thank You to jdella for this post:
Stumbling along, Jeff... although my career started out programming decades ago... it ended 9 years ago as a business process redesign consultant... I swore I wouldn't get back to programming, but the possibilities sucked me back in... get by using others code and modifying it. Check out some of the links in the "Sticky" section... there are quite a few members who have no professional programming experience who are doing great work.
The Dinapoli stochastic indicator colors based on %K / %D crosses using the Dinapoli formulae rather than standard stochastic formulae... while it is possible that is what RodS wants, it isn't what he requested.
your chart looks good... and that consolidation area is nicely colored... would you mind posting your template? I'd like to see how you combined the two... keep in mind that the Dinapoli is a %K/%D cross... nothing to do with levels as far as I could see... correct me if I'm wrong.
As far as I understand your description, my modifications should do what you want... but you haven't said what should happen under all conditions.