NexusFi: Find Your Edge


Home Menu

 





Not retaining colors


Discussion in NinjaTrader

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




 
Search this Thread

Not retaining colors

  #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?
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
Better Renko Gaps
The Elite Circle
What broker to use for trading palladium futures
Commodities
ZombieSqueeze
Platforms and Indicators
 
  #3 (permalink)
 
Jigsaw Trading's Avatar
 Jigsaw Trading  Jigsaw Trading is an official Site Sponsor
 
Posts: 2,988 since Nov 2010
Thanks Given: 831
Thanks Received: 10,393


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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts