NexusFi: Find Your Edge


Home Menu

 





Help with paintbar code.


Discussion in NinjaTrader

Updated
    1. trending_up 3,036 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?
Datafeed for Atas
Platforms and Indicators
Daytrading to swingtrading
Traders Hideout
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Would a node-based workflow for automated trading be useful?
Traders Hideout
Trump Media to sell instant access to market-moving soci …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 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