NexusFi: Find Your Edge


Home Menu

 





Not retaining colors


Discussion in NinjaTrader

Updated
    1. trending_up 2,192 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?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
31 thanks
Bigger Wins or Fewer Losses?
24 thanks
Tao te Trade: way of the WLD
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #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