Support Board
Date/Time: Fri, 29 Mar 2024 04:57:59 +0000
[Programming Help] - Alignment of 3 columns of text with s_UseTool TextAlignment
View Count: 862
[2018-12-17 11:28:29] |
User210074 - Posts: 63 |
Hello, I would like to make 3 columns of text. I have to horizontally align 3 columns on the same price I managed to do it for 2. But as for 3, nothing to do. I can not align horizontally on the second column. Using all possibilities of this page . I can not do it like your NUMBERBAR. I have no idea to do it. Can you explain to me how you do it? test : For 2 #include "sierrachart.h" #include <iostream> #include <string> using std::string; using std::to_string; SCDLLName("Test"); SCSFExport scsf_Test(SCStudyInterfaceRef sc){ SCSubgraphRef A = sc.Subgraph[0]; if(sc.SetDefaults){ sc.GraphName="Test"; sc.FreeDLL=1; sc.AutoLoop=1; sc.GraphRegion=0; sc.UpdateAlways=1; A.Name="Test"; A.DrawStyle=DRAWSTYLE_CUSTOM_TEXT; A.PrimaryColor=RGB(255,255,255); A.LineWidth=10; A.DrawZeros=false; } sc.DeleteACSChartDrawing(sc.ChartNumber,TOOL_DELETE_CHARTDRAWING,1); sc.DeleteACSChartDrawing(sc.ChartNumber,TOOL_DELETE_CHARTDRAWING,2); s_UseTool AAB; AAB.Clear(); AAB.ChartNumber=sc.ChartNumber; AAB.Region=sc.GraphRegion; AAB.DrawingType=DRAWING_TEXT; AAB.LineNumber=1; AAB.BeginIndex=sc.Index; AAB.BeginValue=sc.Low[sc.Index]; AAB.EndIndex=sc.Index; AAB.EndValue=sc.Low[sc.Index]; AAB.Color=A.PrimaryColor; AAB.FontSize=A.LineWidth; AAB.AddMethod=UTAM_ADD_OR_ADJUST; AAB.TextAlignment = DT_RIGHT; string ATXT="1234|5678"; AAB.Text=ATXT.c_str(); sc.UseTool(AAB); s_UseTool AAA; AAA.Clear(); AAA.ChartNumber=sc.ChartNumber; AAA.Region=sc.GraphRegion; AAA.DrawingType=DRAWING_TEXT; AAA.LineNumber=2; AAA.BeginIndex=sc.Index; AAA.BeginValue=sc.Low[sc.Index]; AAA.EndIndex=sc.Index; AAA.EndValue=sc.Low[sc.Index]; AAA.Color=A.PrimaryColor; AAA.FontSize=A.LineWidth; AAA.AddMethod=UTAM_ADD_OR_ADJUST; AAA.TextAlignment = DT_LEFT; string BTXT="abcd|efgh"; AAA.Text=BTXT.c_str(); sc.UseTool(AAA); } But for 3 no #include <string> using std::string; using std::to_string; SCDLLName("Test"); SCSFExport scsf_Test(SCStudyInterfaceRef sc){ SCSubgraphRef A = sc.Subgraph[0]; if(sc.SetDefaults){ sc.GraphName="Test"; sc.FreeDLL=1; sc.AutoLoop=1; sc.GraphRegion=0; sc.UpdateAlways=1; A.Name="Test"; A.DrawStyle=DRAWSTYLE_CUSTOM_TEXT; A.PrimaryColor=RGB(255,255,255); A.LineWidth=10; A.DrawZeros=false; } sc.DeleteACSChartDrawing(sc.ChartNumber,TOOL_DELETE_CHARTDRAWING,1); sc.DeleteACSChartDrawing(sc.ChartNumber,TOOL_DELETE_CHARTDRAWING,2); sc.DeleteACSChartDrawing(sc.ChartNumber,TOOL_DELETE_CHARTDRAWING,3); s_UseTool AAB; AAB.Clear(); AAB.ChartNumber=sc.ChartNumber; AAB.Region=sc.GraphRegion; AAB.DrawingType=DRAWING_TEXT; AAB.LineNumber=1; AAB.BeginIndex=sc.Index; AAB.BeginValue=sc.Low[sc.Index]; AAB.EndIndex=sc.Index; AAB.EndValue=sc.Low[sc.Index]; AAB.Color=A.PrimaryColor; AAB.FontSize=A.LineWidth; AAB.AddMethod=UTAM_ADD_OR_ADJUST; AAB.TextAlignment = DT_RIGHT; string ATXT="1234|5678"; AAB.Text=ATXT.c_str(); sc.UseTool(AAB); s_UseTool AAA; AAA.Clear(); AAA.ChartNumber=sc.ChartNumber; AAA.Region=sc.GraphRegion; AAA.DrawingType=DRAWING_TEXT; AAA.LineNumber=2; AAA.BeginIndex=sc.Index; AAA.BeginValue=sc.Low[sc.Index]; AAA.EndIndex=sc.Index; AAA.EndValue=sc.Low[sc.Index]; AAA.Color=A.PrimaryColor; AAA.FontSize=A.LineWidth; AAA.AddMethod=UTAM_ADD_OR_ADJUST; AAA.TextAlignment = DT_LEFT; string BTXT="abcd|efgh"; AAA.Text=BTXT.c_str(); sc.UseTool(AAA); s_UseTool AAC; AAC.Clear(); AAC.ChartNumber=sc.ChartNumber; AAC.Region=sc.GraphRegion; AAC.DrawingType=DRAWING_TEXT; AAC.LineNumber=3; AAC.BeginIndex=sc.Index; AAC.BeginValue=sc.Low[sc.Index]; AAC.EndIndex=sc.Index; AAC.EndValue=sc.Low[sc.Index]; AAC.Color=A.PrimaryColor; AAC.FontSize=A.LineWidth; AAC.AddMethod=UTAM_ADD_OR_ADJUST; AAC.TextAlignment = DT_LEFT; string CTXT="1234|5678"; AAC.Text=CTXT.c_str(); sc.UseTool(AAC); } |
Attachment Deleted. |
[2018-12-26 10:33:46] |
User210074 - Posts: 63 |
Hi,Merry Christmas. I succeeded. I did what I wanted for my NumberBar to 12 variants of traded market. I post one of them. I have received a message. CTS will change the price (integer) in 2019. Can you give me the date of the change, and the new price format? I will make a patch to be able to exploit the data before and after 2019 Happy end of the year 2018 |
[2018-12-28 19:43:28] |
Sierra Chart Engineering - Posts: 104368 |
I have received a message. CTS will change the price (integer) in 2019. There are no changes in Sierra Chart related to this. We will not do anything that is going to cause a major disruption to our users. Only those trading the CBOT two-year note futures will be affected.
Can you give me the date of the change, and the new price format? Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
To post a message in this thread, you need to log in with your Sierra Chart account: