Login Page - Create Account

Support Board


Date/Time: Fri, 10 May 2024 05:11:05 +0000



Post From: Drawing Tool problems with Custom Profile study

[2018-02-19 07:05:32]
WarriorTrader - Posts: 245
Hello,

I have study that displays a separate one day TOP chart in the fill space of any remote chart. It has been in use by the SC community for over 3 years. It is a convenient way to have two TPO charts for the same day on the same chart, so one can expand one into columns and the other can be just a regular profile. About 5 month ago it stopped working when v1587 came out.

It now only displays one letter or nothing at all.


Thread: Custom Market Profile Chart

https://www.sierrachart.com/Download.php?Folder=SupportBoard&download=4804
https://www.sierrachart.com/Download.php?Folder=SupportBoard&download=4492

Although the logic did not change I checked it anyway to make sure it is noting on my end.

The culprit is the AddAsUserDrawnDrawing UseTools setting. All my drawing tools have it set as follows:

LetterTPO.AddAsUserDrawnDrawing = 1;

When I switched one drawing tool to AddAsUserDrawnDrawing = 0 parts of the “custom profile” in the fill space showed up as expected (see ToolError1 attached).

Then I switched the study to display on a remote chart (from the study settings), as the study is designed to do, and only one letter is displayed. The rest of the study is displayed in the original chart. (see Tool Error2 attached).


Then I tried to switch the chart back to the original chart and the “custom profile” no longer showed up as it did before. This probably is a separate issue dealing with remote charts but you will have to let me know about that (see ToolError3 attached).

The last two pics attached show what is displayed after the v1587 upgrade.

Only one letter shows up ( see ToolError4 and 5).

There is also an inconsistent error when I switch to the remote chart and then back to the original chart in the study settings. Sometimes the “custom profile” shows up and sometimes it does not. Sometimes I just have to press “Insert” to refresh the chart and it shows up as expected and sometimes I have to restart SC and then it comes up fine. So I suspect there is something going on with how remote charts are handled also.

Chartbook also included.


I have included the code of the drawing tool that is being tested. I only changed the AddAsUserDrawnDrawing setting on that tool to keep it simple. The original code is 1500 lines so I will not bother you with that.

I also included two dll’s. One with AddAsUserDrawnDrawing = 1 named _one and one with it = 0 named _zero

The dll’s was compiled with Visual Studio Community 2015 in SC v1689


A lot of people have been asking me to fix the study because it duplicates a feature in other software packages; so many of your users look forward to getting it back up and running.

Thx,
WarriorTrader

PS: The if then statements in the code only deal with the color of the drawing tool so you can take them out for clarity.

            else { //use letters

              LetterTPO.Clear(); // Reset tool structure. Good practice but unnecessary in this case.
              LetterTPO.ChartNumber = RemoteChart; //sc.ChartNumber;
              LetterTPO.AddAsUserDrawnDrawing = 1;

              LetterTPO.DrawingType = DRAWING_TEXT;
              LetterTPO.TextAlignment = DT_VCENTER | DT_CENTER;
              //LetterTPO.MarkerType = MARKER_SQUARE;
              //LetterTPO.UseBarSpacingForMarkerSize=1;
              LetterTPO.FontSize = TPOFontSize.GetInt();
              LetterTPO.LineNumber = 6417888;
              


              //BarIndex = max(0, sc.ArraySize - 35);
              //LetterTPO.BeginIndex = SavedPrevHighPivotIndex;
              
       LetterTPO.BeginDateTime = ProfileDateTime[ProfileSize + LevelCount[StaticLength] + 1];
//(LevelCount[StaticLength]+1)*-1;
              LetterTPO.BeginValue = CurrentValue;
              char LetterOut;
              if (LevelCount[StaticLength + Offset] > 25)
                LetterOut = 'Z';
              else
                LetterOut = LetterArray[HistoryIndex - DyanmicLookbackIndex + Offset]; //LetterArray[LevelCount[StaticLength]-1];

              LetterTPO.Text.Format("%c", LetterOut);

              if (HistoryIndex == DyanmicLookbackIndex) {

                if (sc.Open[DyanmicLookbackIndex] == CurrentValue) {
                  LetterTPO.Color = OpenColor.GetColor();
                }
                else {
                  LetterTPO.Color = BalancedColor.GetColor();
                }
              }

              else if (CurrentValue > (sc.High[HistoryIndex - 1] + TICK))

                LetterTPO.Color = BreakoutColor.GetColor();

              else if (CurrentValue < (sc.Low[HistoryIndex - 1] - TICK))

                LetterTPO.Color = BreakdownColor.GetColor();
              else

                LetterTPO.Color = BalancedColor.GetColor();

              LetterTPO.AddMethod = UTAM_ADD_ALWAYS;
              //LetterTPO.MarkerSize = BlockSizeNum;
              //LetterTPO.LineWidth = 3;

              sc.UseTool(LetterTPO);

Date Time Of Last Edit: 2018-02-19 09:44:19
imageToolError1.png / V - Attached On 2018-02-19 06:37:13 UTC - Size: 96.23 KB - 301 views
imageToolError2.png / V - Attached On 2018-02-19 06:37:30 UTC - Size: 138.17 KB - 282 views
imageToolError3.png / V - Attached On 2018-02-19 06:37:43 UTC - Size: 132.78 KB - 236 views
imageToolError4.png / V - Attached On 2018-02-19 06:37:52 UTC - Size: 92.54 KB - 283 views
imageToolError5.png / V - Attached On 2018-02-19 06:38:00 UTC - Size: 108.09 KB - 272 views
Private File
Private File
attachmentCustomProfile_SC_1684.dll - Attached On 2018-02-19 06:44:19 UTC - Size: 110 KB - 314 views
attachmentCustomProfileTest.Cht - Attached On 2018-02-19 06:44:44 UTC - Size: 61.91 KB - 295 views