NexusFi: Find Your Edge


Home Menu

 





Not retaining colors


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 kashter 
Moving
 
Experience: Intermediate
Platform: NT
Broker: Mirus/Zen Fire
Trading: ES
Posts: 82 since May 2010
Thanks Given: 90
Thanks Received: 44

Hi,
I am trying to code this volume counter to retain its colors but I seem to fail to achieve this. Not much of a programmer, but with the little knowledge I have thought serializing the colors in the property section would keep the colors. Any help appreciated.


Attached Files
Elite Membership required to download: AAVolCounter.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran War Prediction Markets: Ceasefire 16%, Ground Invas …
Prediction Markets & Event Contracts
Kalshi Rockets to $22B, Passes Polymarket in Volume -- B …
Prediction Markets & Event Contracts
Synapse Pro - Trade Copier with topstep and MT5 integrat …
NinjaTrader
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
MegaETH Proves the Crowd Right: Prediction Markets Calle …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 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)
 
Jigsaw Trading's Avatar
 Jigsaw Trading 
Bangkok
 Vendor: www.jigsawtrading.com 
 
Experience: Intermediate
Platform: MultiCharts.NET, S5, Ninj
Broker: AMP, S5, IB
Trading: ES
Posts: 2,988 since Nov 2010
Thanks Given: 831
Thanks Received: 10,399


Here's a snippet from my code that does save the colours....

 
Code
        [XmlIgnore()]
        [Description("At Ask For Color")]
        [GridCategory("Appearance")]
        public Color AtAskColor {
            get { return foreColor[(int)PriceType.AT_ASK]; }
            set { foreColor[(int)PriceType.AT_ASK] = value; }
        }
        
        [Browsable(false)]
        public string AtAskColorSerialize {
            get { return NinjaTrader.Gui.Design.SerializableColor.ToString(foreColor[(int)PriceType.AT_ASK]); }
            set { foreColor[(int)PriceType.AT_ASK] = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
        }
Hope it helps.

Pete


Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
 kashter 
Moving
 
Experience: Intermediate
Platform: NT
Broker: Mirus/Zen Fire
Trading: ES
Posts: 82 since May 2010
Thanks Given: 90
Thanks Received: 44

Pete,
Tried out your snippet but getting all sorts of errors, not to mention your code seems sophisticated for my basic level!
Errors include "cannot convert Syste.Drawing.Color to 'int' for the bit "return foreColor[(int)..."

Will work on it, any more (simpler clues would be appreciated.


DionysusToast View Post
Here's a snippet from my code that does save the colours....

 
Code
        [XmlIgnore()]
        [Description("At Ask For Color")]
        [GridCategory("Appearance")]
        public Color AtAskColor {
            get { return foreColor[(int)PriceType.AT_ASK]; }
            set { foreColor[(int)PriceType.AT_ASK] = value; }
        }
        
        [Browsable(false)]
        public string AtAskColorSerialize {
            get { return NinjaTrader.Gui.Design.SerializableColor.ToString(foreColor[(int)PriceType.AT_ASK]); }
            set { foreColor[(int)PriceType.AT_ASK] = NinjaTrader.Gui.Design.SerializableColor.FromString(value); }
        }
Hope it helps.

Pete


Started this thread Reply With Quote
  #5 (permalink)
 kashter 
Moving
 
Experience: Intermediate
Platform: NT
Broker: Mirus/Zen Fire
Trading: ES
Posts: 82 since May 2010
Thanks Given: 90
Thanks Received: 44

Solved!

FWIW, applied the color code change within the DrawText and now works.


Started this thread Reply With Quote




Last Updated on March 6, 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