NexusFi: Find Your Edge


Home Menu

 





Help with paintbar code.


Discussion in NinjaTrader

Updated
    1. trending_up 2,867 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
bfreefalling
arroyo grande calif
 
Posts: 1 since Mar 2011
Thanks Given: 0
Thanks Received: 0

I'm new at this and trying to learn how to write script.

Would like an example of how to write a paintbar indicator (candle or OHLC) for the following:

2 CCI indicators one being a period of 5 and another being a period of 20 as examples.

The 20 period CCI closing in between the -50 and +50 areas and a spread of 100 or greater between its closing number and the CCI 5 period closing number (example cci 20 being +45 and the CCI 5 being -55 or greater).

I would like the PRICE bar that follows after this occurance to paint a different color if it's closing price is lower (or higher depending on the direction of the movement) indicating a potential pivot.

thank you so much.
Dave


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
South Korea Suspends Bithumb for Six Months Over AML Fai …
Cryptocurrency
Zytrade: Devin Brady, CEO - Ask Me Anything (AMA)
Brokers
Tradeify 3.0 Overhauls Futures Prop Firm Model -- One-Ti …
Funded Trading Evaluation Firms
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
Post-Summit Scorecard: $36M in May 15 Bets Settle Near-Z …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #3 (permalink)
 eman 
Galveston ,TX
 
Experience: Intermediate
Platform: NT7
Broker: Zaner
Trading: Futures
Posts: 386 since Mar 2010
Thanks Given: 364
Thanks Received: 435


you can set BackColor, BarColor, and CandleOutlineColor based on your trigger criteria.

here's a link to the NT7 Help Guide

also, if you are going to allow the users to select a color, don't forget to serialize it ... here's a code-snippet to illustrate:

 
Code
        [XmlIgnore()]
        [Description("Select the color")]
        public Color MyColor
        {
            get { return _MyColor; }
            set { _MyColor = value; }
        }
        [Browsable(false)]
        public string MyColor_Serialize
        {
            get { return NinjaTrader.Gui.Design.SerializableColor.ToString(_MyColor); }
            set { _MyColor = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
        }
        private Color _MyColor = Color.Blue;
cheers,
-e


Reply With Quote
Thanked by:




Last Updated on April 28, 2011


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts