Support Board
Date/Time: Mon, 19 May 2025 15:19:12 +0000
Post From: Accesing Prive Color Value
[2024-02-02 08:32:09] |
User366743 - Posts: 14 |
I have custom study (MQ Trender Pro) painting the price bars on main price chart. It works well visually. However, in order to automate/ act on this study other than manually/ visually I would need to reference to the price colors (the study does not have any meaningful output and does most of the the work internally. the RGB colors painted are RGB colors used: magenta 255 0 255 -->10 gray 211 211 211 -->20 dark green 0 100 0 -->30 green 0 255 0 -->40 dark red 139 0 0 -->50 red 255 0 0 -->60 cyan 0 255 255 -->70 How do I access the color value of a current price bar? ============================= My concept ASCIL - tell me what should I change to return the value of the price color. #include "sierrachart.h" SCDLLName("ReadColorBar") SCSFExport scsf_ColorBar(SCStudyInterfaceRef sc) { SCSubgraphRef ColorBar = sc.Subgraph[0]; If (sc.GraphDrawType != GDT_CUSTOM) { ColorBar.Name = "Color Bar"; ColorBar.DrawStyle = DRAWSTYLE_COLOR_BAR; unsigned int ColorValue = ColorBar.PrimaryColor; int cVal = 0; If (ColorValue = RGB(255,0,255)){ cVal = 10; } else if (ColorValue = RGB(211,211,211)){ cVal = 20; } else if (ColorValue = RGB(0,100,0)){ cVal = 30; } else if (ColorValue = RGB(0,255,0)){ cVal = 40; } else if (ColorValue = RGB(139,0,0)){ cVal = 50; } else if (ColorValue = RGB(255,0,0)){ cVal = 60; } else if (ColorValue = RGB(0,255,255)){ cVal = 70; } sc.FreeDLL = 1; return; } else { //; } } Date Time Of Last Edit: 2024-02-02 15:49:43
|
![]() ![]() |