Login Page - Create Account

Support Board


Date/Time: Tue, 26 Nov 2024 17:16:53 +0000



Post From: Transparency and Replay Mode

[2023-11-11 17:41:29]
stockwet - Posts: 32
Looking for some programming help. I'm working on an indicator that will draw rectangles based on my criteria. Currently, I have a for loop that draws each rectangle. When I'm in the chart normally, everything works perfectly. When I go into replay mode, I lose the opacity of the lines.

Image 1: What it should look like. Transparency set to 65

Image 2: Starting replay fresh.

Image 3: As replay continues.

Here's some of my code ...


for (auto barIndex = sc.ArraySize-1; barIndex >= (sc.ArraySize-InLookback); barIndex--)
{
if (barIndex < (sc.ArraySize-InLookback))
break;
if (sc.GetBarHasClosedStatus(barIndex) == BHCS_BAR_HAS_CLOSED)
{
auto rectangle = s_UseTool();
rectangle.ChartNumber = sc.ChartNumber;
rectangle.Region = sc.GraphRegion;
rectangle.AddMethod = UTAM_ADD_ALWAYS;
rectangle.BeginValue = Close[barIndex-1];
rectangle.EndValue = Open[barIndex];
rectangle.BeginIndex = barIndex-1;
rectangle.EndIndex = barIndex + (sc.ArraySize - barIndex);
rectangle.DrawingType = DRAWING_RECTANGLEHIGHLIGHT;
rectangle.LineStyle = LINESTYLE_SOLID;
rectangle.LineWidth = 0;
rectangle.TransparencyLevel = InLineTrans;
// BEAR BARS
if (Close[barIndex-1] < Open[barIndex-1] && Close[barIndex] <= Open[barIndex])
{

// Find GIBs
if (Close[barIndex-1] > Open[barIndex] && Close[barIndex-1] == Low[barIndex-1])
{
if (InGibShow == 1)
{
rectangle.SecondaryColor = InGibColor;
//TEST: I added this next line as a test. With or without, same effect.
rectangle.TransparencyLevel = InLineTrans;
// END TEST
IbType = 1;
}

}

I'm novice with C++ based languages, so, go easy on me :) Any help is appreciated.
imageimage 1.png / V - Attached On 2023-11-11 17:40:32 UTC - Size: 121.47 KB - 63 views
imageimage 2.png / V - Attached On 2023-11-11 17:40:38 UTC - Size: 108.63 KB - 64 views
imageimage 3.png / V - Attached On 2023-11-11 17:40:43 UTC - Size: 129.12 KB - 62 views