NexusFi: Find Your Edge


Home Menu

 





Oooo pretty colors


Discussion in EasyLanguage Programming

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




 
Search this Thread

Oooo pretty colors

  #1 (permalink)
swingbatter
Arlington
 
Posts: 18 since Feb 2020
Thanks Given: 6
Thanks Received: 3

This line of code is making each candlestick a different color in my PaintBar study. (Resaving changes the color palette.)

PlotPB(High, Low, Open, Close, "", elsystem.drawing.color.FromArgb(255,255,255,255) );

Any idea why? Shouldn't it just make them all white?

Attached Thumbnails
Click image for larger version

Name:	PBcolors.png
Views:	110
Size:	4.8 KB
ID:	321109  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
Are there any eval firms that allow you to sink to your …
Traders Hideout
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
36 thanks
NexusFi site changelog and issues/problem reporting
25 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

swingbatter,

as far as I am aware legacy plots are not designed to use Color objects, they are intended for the standard or custom foreground and background color to a Forms control or DrawingObject (while plots are not a DrawingObject). Plots expect legacy colors, one of the 16 named colors (like Red or Blue etc.) or RGB/ARGB values.
"elsystem.drawing.color.FromArgb(255,255,255,255)" is not an integer or double and what value Tradestation uses
when you use it with legacy plots might be a question to ask the developers directly. The reason why you are seeing different
colors for every bar is likely due to the fact that you create a new instance of the object on every code calculation.
If you would create the color once only and then use that going forward, you should see the same color for all bars (although likely
not white).

For your code snippet the better approach would be using something along the lines of:

Variables:
int plotColor ( ARGB( 255, 255, 255, 255) );

PlotPB(High, Low, Open, Close, "", plotColor );

Regards,

ABCTG



swingbatter View Post
This line of code is making each candlestick a different color in my PaintBar study. (Resaving changes the color palette.)

PlotPB(High, Low, Open, Close, "", elsystem.drawing.color.FromArgb(255,255,255,255) );

Any idea why? Shouldn't it just make them all white?


Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
swingbatter
Arlington
 
Posts: 18 since Feb 2020
Thanks Given: 6
Thanks Received: 3



ABCTG View Post
swingbatter,

as far as I am aware legacy plots are not designed to use Color objects, they are intended for the standard or custom foreground and background color to a Forms control or DrawingObject (while plots are not a DrawingObject). Plots expect legacy colors, one of the 16 named colors (like Red or Blue etc.) or RGB/ARGB values.
"elsystem.drawing.color.FromArgb(255,255,255,255)" is not an integer or double and what value Tradestation uses
when you use it with legacy plots might be a question to ask the developers directly. The reason why you are seeing different
colors for every bar is likely due to the fact that you create a new instance of the object on every code calculation.
If you would create the color once only and then use that going forward, you should see the same color for all bars (although likely
not white).

For your code snippet the better approach would be using something along the lines of:

Variables:
int plotColor ( ARGB( 255, 255, 255, 255) );

PlotPB(High, Low, Open, Close, "", plotColor );

Regards,

ABCTG

Yes indeed! Thank you ABCTG. Always so knowledgeable.

Reply With Quote




Last Updated on January 5, 2022


© 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