Can bars be 'colored' by another bar state? - NinjaTrader Programming | futures io social day trading
futures io futures trading


Can bars be 'colored' by another bar state?
Updated: Views / Replies:1,292 / 8
Created: by Trader.Jon 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
 

Can bars be 'colored' by another bar state?

  #1 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received

Can bars be 'colored' by another bar state?

I have looked at Point n Figure (PnF) barcharts occasionally, and do think of making a strategy built on some of that functionality.

Meanwhile, I wonder if it is possible to color (example) range bars (bearish, bullish) based on the last 'state' of the PnF whether the last drawn was an 'O' or an 'X' ?? Likely best done only in NT7 as PnF is 'native' there. Would this best be done as a new bar type or as an indicator? From the discussions about bar types here I am not too keen on even attempting those

I did look at the code of the NT7 '@BarsTypes.cs" but cant make enough sense of it to know where to start getting the 'trigger' to change the color state of the range bar. Of course, I want to still be able to change the input parameters available in NT7 to change the PnF bar parameters.

Any help is appreciated (but I am am still a novice at code writing and specific example code is ssSSOOO useful, generalization of steps will likely just get me asking more questions),



TIA
Jon

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
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,651 since Mar 2010
Thanks: 4,226 given, 25,601 received
Forum Reputation: Legendary



Trader.Jon View Post
I have looked at Point n Figure (PnF) barcharts occasionally, and do think of making a strategy built on some of that functionality.

Meanwhile, I wonder if it is possible to color (example) range bars (bearish, bullish) based on the last 'state' of the PnF whether the last drawn was an 'O' or an 'X' ?? Likely best done only in NT7 as PnF is 'native' there. Would this best be done as a new bar type or as an indicator? From the discussions about bar types here I am not too keen on even attempting those

I did look at the code of the NT7 '@BarsTypes.cs" but cant make enough sense of it to know where to start getting the 'trigger' to change the color state of the range bar. Of course, I want to still be able to change the input parameters available in NT7 to change the PnF bar parameters.

Any help is appreciated (but I am am still a novice at code writing and specific example code is ssSSOOO useful, generalization of steps will likely just get me asking more questions),



TIA
Jon

NinjaTrader has a zigzag indicator, which can probably be used to simulate a point and figure chart. All you would need to do is to substitute the minimum devaition of the zig zag for the reversal size of the point and figure chart. Make sure that the zigzag is attached to the close. Once a zigzag is drawn, this starts a new column of your P&F charts. You can easily use this approach to colour your bars.

Reply With Quote
 
  #4 (permalink)
Elite Member
Orlando, Florida
 
Futures Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Favorite Futures: ES
 
Posts: 56 since Aug 2010
Thanks: 3 given, 66 received

Jon,
I think it would be easiest for you to create an indicator to do this. I have the following code that I think you could modify this pretty easily to suit your needs.

 
Code
                            

ind
.Set(Close[0]);                        
                        
            if (
trend==1)
            {
                if (
ind[0]<=hw)
                {
                    
trend=-1;
                    
hw=ind[0]+signal*TickSize;
                    
tnum++;
                    
DrawArrowDown(tnum.ToString(),true,0,High[0]+2*TickSize,Color.Red);
                    
signaled=true;
                }
                else 
hw=Math.Max(hw,ind[0]-signal*TickSize);
                                
                
BarColor=Color.Blue;                                
            }
            
            else if (
trend==-1)
            {
                if (
ind[0]>=hw)
                {
                    
trend=1;
                    
hw=ind[0]-signal*TickSize;
                    
tnum++;
                    
DrawArrowUp(tnum.ToString(),true,0,Low[0]-2*TickSize,Color.Green);
                    
signaled=true;
                }
                else 
hw=Math.Min(hw,ind[0]+signal*TickSize);
                                
                
BarColor=Color.Red;
            }        
            
            else
            {
                
trend=1;
                
hw=ind[0]-signal*TickSize;
            } 

Trader.Jon View Post
I have looked at Point n Figure (PnF) barcharts occasionally, and do think of making a strategy built on some of that functionality.

Meanwhile, I wonder if it is possible to color (example) range bars (bearish, bullish) based on the last 'state' of the PnF whether the last drawn was an 'O' or an 'X' ?? Likely best done only in NT7 as PnF is 'native' there. Would this best be done as a new bar type or as an indicator? From the discussions about bar types here I am not too keen on even attempting those

I did look at the code of the NT7 '@BarsTypes.cs" but cant make enough sense of it to know where to start getting the 'trigger' to change the color state of the range bar. Of course, I want to still be able to change the input parameters available in NT7 to change the PnF bar parameters.

Any help is appreciated (but I am am still a novice at code writing and specific example code is ssSSOOO useful, generalization of steps will likely just get me asking more questions),



TIA
Jon



Last edited by sam028; August 13th, 2010 at 03:35 PM. Reason: replace [CODE] by [PHP]
Reply With Quote
The following 2 users say Thank You to MooreTech for this post:
 
  #5 (permalink)
Elite Member
Madison, WI
 
Futures Experience: Advanced
Platform: Sierra Charts, ALT
Favorite Futures: ES
 
aslan's Avatar
 
Posts: 614 since Jan 2010
Thanks: 342 given, 1,077 received

I dont do PnF charts, but here are a few comments:

* BarTypes are for building bars, not really the right place to color a bar

* ChartStyles are for displaying the bars in a custom manner, you could set the color here, but since you want to use another bar type to set the color of this bar type, it is not going to be easy to do, if its even possible

* Indicator - this is the place to do it, as an indicator can also set the color of the bars based on pretty much anything you can get access to. I think you could add another data series to an indicator (i.e. add a PnF period bar), and then use the state of the second data source to color the bars. This is a NT7 feature.

Perhaps others have some more ideas.

Reply With Quote
The following user says Thank You to aslan for this post:
 
  #6 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received


Fat Tails View Post
NinjaTrader has a zigzag indicator, which can probably be used to simulate a point and figure chart. All you would need to do is to substitute the minimum devaition of the zig zag for the reversal size of the point and figure chart. Make sure that the zigzag is attached to the close. Once a zigzag is drawn, this starts a new column of your P&F charts. You can easily use this approach to colour your bars.

That approach had never even crossed my mind ... I'll put it on my 'to do' for my eyeballs and see what it looks like!

Thanks,
Jon

Reply With Quote
 
  #7 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received


MooreTech View Post
Jon,
I think it would be easiest for you to create an indicator to do this. I have the following code ... }

[/PHP]

Moore,

1 vote for indicator !!!

Thanks for the inspiration ... I will give a go at it, I do wonder though if its going to be an issue as the PnF bars have multiple segments, and waiting on the bar close will effect the outcome ... 'top of my head' guess at the code snip you provided looks as designed for bar to be closed .. or am I wrong?

Jon

Reply With Quote
 
  #8 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received


aslan View Post
I dont do PnF charts, but here are a few comments:

* BarTypes are for building bars, not really the right place to color a bar

* ChartStyles are for displaying the bars in a custom manner, you could set the color here, but since you want to use another bar type to set the color of this bar type, it is not going to be easy to do, if its even possible

* Indicator - this is the place to do it, as an indicator can also set the color of the bars based on pretty much anything you can get access to. I think you could add another data series to an indicator (i.e. add a PnF period bar), and then use the state of the second data source to color the bars. This is a NT7 feature.

Perhaps others have some more ideas.

Aslan,

2 votes for indicator !!!


I appreciate the analysis of the options ... I parsed out the PnF parts from the NT7 BarsType.cs and will use that to help me chart these unknown waters.

Jon

Reply With Quote
 
  #9 (permalink)
Elite Member
Orlando, Florida
 
Futures Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Favorite Futures: ES
 
Posts: 56 since Aug 2010
Thanks: 3 given, 66 received

Jon,
You can run the code provided intrabar (CalculateOnBarClose=false).


Trader.Jon View Post
Moore,

1 vote for indicator !!!

Thanks for the inspiration ... I will give a go at it, I do wonder though if its going to be an issue as the PnF bars have multiple segments, and waiting on the bar close will effect the outcome ... 'top of my head' guess at the code snip you provided looks as designed for bar to be closed .. or am I wrong?

Jon


Reply With Quote

Reply



futures io > > > > > Can bars be 'colored' by another bar state?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
MACD with Colored Histogram timefreedom The Elite Circle 9 October 3rd, 2017 02:43 PM
highest bar close occuring within the last X number of bars . . . . jmejedi NinjaTrader Programming 37 October 6th, 2014 01:52 AM
Colored regression indicator lost Doppio NinjaTrader 2 July 29th, 2011 01:18 AM
Anyone know of a slope-colored EMA that repaints properly? Surly NinjaTrader 5 June 23rd, 2011 02:03 PM
Latest US Foreclosure 'Mess' Will Unfold State by State Quick Summary News and Current Events 0 September 29th, 2010 08:50 PM


All times are GMT -4. The time now is 03:07 AM.

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-13 in 0.14 seconds with 19 queries on phoenix via your IP 54.226.132.197