Stochastics coding help needed! - NinjaTrader Programming | futures io social day trading
futures io futures trading


Stochastics coding help needed!
Updated: Views / Replies:6,801 / 33
Created: by RodS Attachments:12

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 12  
 
Thread Tools Search this Thread
 

Stochastics coding help needed!

  #1 (permalink)
Elite Member
Indy
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: 6E,TF,YM,NQ
 
RodS's Avatar
 
Posts: 88 since Jun 2009
Thanks: 433 given, 65 received

Stochastics coding help needed!

Hi All!!

I need some help from the programing guru's on the forum.....as I have none :sos:.

Max-td kindly contributed the attached stoch_alert.zip file that he had. This was post #21 from Trading CL (Crude Oil Futures). I was wanting to make a couple of changes to it.

I was wanting to have the background color change to green when the K% line rises above the 30 line and to stay green until the K% drops below the 70 line in which it turns red.

I did want to keep the audio alerts in!

Thanks in advance for any help!

Rod

Attached Thumbnails
Stochastics coding help needed!-zn-stoch.jpg  
Attached Files
Register to download File Type: zip Stoch_Alerts.zip (18.6 KB, 62 views)
Reply With Quote
 
  #2 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

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

Reply With Quote
 
  #3 (permalink)
Elite Member
Sydney - Australia
 
Futures Experience: Intermediate
Platform: Ninja Trader
Broker/Data: Velocity Futures
Favorite Futures: ES, 6E
 
Alan's Avatar
 
Posts: 155 since Jun 2009
Thanks: 1,441 given, 138 received


Hi RodS,

I think that this is what you are after. It's from the Ninja Site:

Dinapoli Stochastic - Page 2 - NinjaTrader Support Forum

I have used this many times and I think that it works really well. Give it a go and see is this does what you are after.

Reply With Quote
The following 2 users say Thank You to Alan for this post:
 
  #4 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received

here is from nt forum http://www.ninjatrader-support2.com/vb/local_links.php?catid=1&sort=N&pp=15&page=4

Attached Files
Register to download File Type: zip DinapoliStochastic.zip (7.0 KB, 89 views)
Reply With Quote
The following user says Thank You to wh for this post:
 
  #5 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

I think this is what you are asking for RodS

Stoch_K_Color_Alerts_sg




Added functionality:
  1. Select level for coloring %K when between OSValue and OBValue depending on whether rising or falling
  2. Select the background colors for %K conditions
  3. 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).

Attached Thumbnails
Stochastics coding help needed!-stochkcoloralert-rods.png  
Attached Files
Register to download File Type: cs _Stoch_K_Color_Alert_sg.cs (15.3 KB, 47 views)
Register to download File Type: zip StochKColorAlertforRodS.zip (11.5 KB, 71 views)

Last edited by Saroj; August 28th, 2009 at 10:40 AM. Reason: Attaching image and NT import file
Reply With Quote
The following user says Thank You to Saroj for this post:
 
  #6 (permalink)
Elite Member
Concord, NH USA
 
Futures Experience: Intermediate
Platform: Ninja trader
Broker/Data: AMP/CQG
Favorite Futures: ES
 
jdella's Avatar
 
Posts: 182 since Jun 2009
Thanks: 134 given, 110 received

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.

Jeff

Reply With Quote
The following user says Thank You to jdella for this post:
 
  #7 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received

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.

Reply With Quote
 
  #8 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received



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.

Reply With Quote
 
  #9 (permalink)
Elite Member
Indy
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: 6E,TF,YM,NQ
 
RodS's Avatar
 
Posts: 88 since Jun 2009
Thanks: 433 given, 65 received

Hi Saroj,


Sorry for the late response. I have been having major connection problems with my service provider today!!! Hopefully it's fixed.

First off thanks for your help in this. i haven't checked what you have coded for me but at first glimpse it looks good. I have attached a new chark that should show better what i am looking for.

I actually combined the Dinapoli Stochastic and Stoch_K_Color_Alert to form panel 2. This is pretty much what I was looking for.

The current alerts are triggered for when K% is rising and crosses from below OBValue line and when K% is falling and crosses from above OSValue line.

Where I want my signal is when K% is above the OBValue line (70 -100) and drops below 70, or user defined value, I want a short .wav signal.

And when K% is below the OSValue line (0-30) and rises above 30,or user defined, I want a long.wav signal.

I am not using these as entries. I am using these as heads up to be used with other indicators and price action for a possible entry.

Thanks also to Alan and wh for the dinapoli stochastic link!

Thanks

Rod

Attached Thumbnails
Stochastics coding help needed!-zn-09-09-8_27_2009-4-range-combined.jpg  
Reply With Quote
 
  #10 (permalink)
Elite Member
Arcata, CA
 
Futures Experience: Intermediate
Platform: NinjaTrader
Favorite Futures: index futures, oil
 
Saroj's Avatar
 
Posts: 482 since Jun 2009
Thanks: 223 given, 389 received


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.

Reply With Quote

Reply



futures io > > > > > Stochastics coding help needed!

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stochastics min/max Prediction within range bar gain247 NinjaTrader 24 August 7th, 2011 12:51 AM
Stochastics Cross Indicator DennisA NinjaTrader 1 March 30th, 2011 07:30 PM
Stochastics Crossover Alert Indicator -> coding- WORKSHOP engl98 The Elite Circle 40 January 20th, 2011 10:32 PM
Strategy Coding - help needed - ORB & Trailing conditions RodS The Elite Circle 24 December 8th, 2010 09:30 AM
compare stochastics on different charting software traderTX NinjaTrader Programming 18 April 20th, 2010 10:13 PM


All times are GMT -4. The time now is 01:53 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-15 in 0.13 seconds with 20 queries on phoenix via your IP 54.82.56.95