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



Can bars be 'colored' by another bar state?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Trader.Jon with 4 posts (0 thanks)
    2. looks_two MooreTech with 2 posts (2 thanks)
    3. looks_3 aslan with 1 posts (1 thanks)
    4. looks_4 Fat Tails with 1 posts (0 thanks)
    1. trending_up 2,573 views
    2. thumb_up 3 thanks given
    3. group 4 followers
    1. forum 8 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

Can bars be 'colored' by another bar state?

(login for full post details)
  #1 (permalink)
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 183 received

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

Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(170 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(116 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #3 (permalink)
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,728 received



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
 
(login for full post details)
  #4 (permalink)
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
 
Posts: 57 since Aug 2010
Thanks: 6 given, 73 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


Follow me on Twitter Reply With Quote
The following 2 users say Thank You to MooreTech for this post:
 
(login for full post details)
  #5 (permalink)
Madison, WI
 
Experience: Advanced
Platform: ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,109 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:
 
(login for full post details)
  #6 (permalink)
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 183 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

Started this thread Reply With Quote
 
(login for full post details)
  #7 (permalink)
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 183 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

Started this thread Reply With Quote
 
(login for full post details)
  #8 (permalink)
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 183 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

Started this thread Reply With Quote
 
(login for full post details)
  #9 (permalink)
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
 
Posts: 57 since Aug 2010
Thanks: 6 given, 73 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


Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Can bars be 'colored' by another bar state?


Last Updated on August 13, 2010


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
     



Copyright © 2021 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