Indicator Programming Help!!! @ ColorfulCandles - NinjaTrader Programming | futures io social day trading
futures io futures trading


Indicator Programming Help!!! @ ColorfulCandles
Updated: Views / Replies:526 / 4
Created: by Ph03nix Attachments:0

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
 
Thread Tools Search this Thread
 

Indicator Programming Help!!! @ ColorfulCandles

  #1 (permalink)
Trading Apprentice
Frankfurt + Germany
 
Futures Experience: Beginner
Platform: mt4
Favorite Futures: EUR/USD
 
Posts: 3 since Sep 2013
Thanks: 0 given, 0 received

Indicator Programming Help!!! @ ColorfulCandles

Hi guys!

I want to write an indicator which makes all candles grey, except the candles with high volatility. (Ninjatrader)
My volatility base would have been the ATR. So the candles that exceed the ATR or 2*ATR or whatever will be colored (red/green) - if not, it stays grey.

Something is messed up in my code and I would need your help... :S

This is the part where the coloring should happen....

#region Variables
private Color candleOutlineUp = Color.Lime;
private Color candleOutlineDown = Color.OrangeRed;
private Color candleOutlineDoji = Color.White;
private Color candleOutlineNeutral = Color.Gray;
#endregion

/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = false;
Overlay = true;
AutoScale = true;
PriceTypeSupported = false;
DisplayInDataBox = false;
PaintPriceMarkers = false;
}
double ATRValue = 0;
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
ATRValue = ATR(24)[0];
if ( (Close[0]-Open[0]) > ATRValue )
BarColor = candleOutlineUp;
if ( (Close[0]-Open[0]) < -ATRValue )
BarColor = candleOutlineDown;
else
BarColor = candleOutlineDoji;
}

Could you help me out?
Thanks!


Last edited by Ph03nix; December 10th, 2013 at 01:33 PM.
Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received



Ph03nix View Post
Hi guys!

I want to write an indicator which makes all candles grey, except the candles with high volatility. (Ninjatrader)
My volatility base would have been the ATR. So the candles that exceed the ATR or 2*ATR or whatever will be colored (red/green) - if not, it stays grey.

Something is messed up in my code and I would need your help... :S

This is the part where the coloring should happen....

#region Variables
private Color candleOutlineUp = Color.Lime;
private Color candleOutlineDown = Color.OrangeRed;
private Color candleOutlineDoji = Color.White;
private Color candleOutlineNeutral = Color.Gray;
#endregion

/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = false;
Overlay = true;
AutoScale = true;
PriceTypeSupported = false;
DisplayInDataBox = false;
PaintPriceMarkers = false;
}
double ATRValue = 0;
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
ATRValue = ATR(24)[0];
if ( (Close[0]-Open[0]) > ATRValue )
BarColor = candleOutlineUp;
if ( (Close[0]-Open[0]) < -ATRValue )
BarColor = candleOutlineDown;
else
BarColor = candleOutlineDoji;
}

Could you help me out?
Thanks!

Just taking a quick look i don't see anything obvious. Have you tried using Print statements to verify the actual value of ATR? Have you tried using print statements in between the if statements to verify the conditions are true?

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Frankfurt + Germany
 
Futures Experience: Beginner
Platform: mt4
Favorite Futures: EUR/USD
 
Posts: 3 since Sep 2013
Thanks: 0 given, 0 received

Something is still messed up in my code, but it seems working now.
Thanks

Reply With Quote
 
  #5 (permalink)
 Vendor: www.probabletrades.com 
OC, California, USA
 
Futures Experience: Advanced
Platform: IB/TWS, NinjaTrader, thinkorswim
Favorite Futures: stocks, options, futures, VIX
 
shodson's Avatar
 
Posts: 1,860 since Jun 2009
Thanks: 480 given, 3,255 received

You are comparing

Close - Open

to your ATR value, but I think you want

High - Low

As volatility is usually a measure of the range of a bar, which is the high - the low.

Also, what is the condition for your neutral color? In your logic every bar will be either an up, down, or doji.

Reply With Quote
The following user says Thank You to shodson for this post:

Reply



futures io > > > > > Indicator Programming Help!!! @ ColorfulCandles

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
Simplier way of Programming an Indicator Into the Strategy? Genshin Elite Automated NinjaTrader Trading 5 November 2nd, 2013 09:15 PM
Trouble Programming Simple Indicator buddy858 NinjaTrader Programming 16 September 18th, 2013 02:00 AM
Indicator programming Mondrakete NinjaTrader Programming 3 April 3rd, 2011 02:02 PM
Programming help for making an Indicator into a strategy. How do I ask? Mojokix NinjaTrader Programming 6 January 7th, 2011 04:19 AM
indicator programming help needed GoldStandard The Elite Circle 3 August 29th, 2010 04:42 PM


All times are GMT -4. The time now is 12:50 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-18 in 0.11 seconds with 19 queries on phoenix via your IP 54.196.201.241