Support Board
Date/Time: Sun, 28 Apr 2024 18:56:25 +0000
[Programming Help] - Value not displayed on chart
View Count: 518
[2020-10-09 08:26:11] |
gfx2trade - Posts: 48 |
Hi Sc team, I am struggling with the sc.UseTool function. I am just trying to display 10 on top of each bar ... And nothing is displayed. Thks #include "sierrachart.h"
/****************************************************************************/ SCDLLName("Gfx Test") /****************************************************************************/ /*============================================================================ This code calculates the gfx Inside Bar ----------------------------------------------------------------------------*/ SCSFExport scsf_gfxIB(SCStudyInterfaceRef sc) { if(sc.SetDefaults) { sc.GraphName="GFX TEST"; sc.ProtectStudy = 1; sc.AutoLoop = 1; sc.GraphRegion = 0; return; } // if(sc.SetDefaults) s_UseTool myTool; myTool.Clear(); // Reset tool structure. Good practice but unnecessary in this case. myTool.ChartNumber = sc.ChartNumber; myTool.Region = sc.GraphRegion; myTool.Text = "10"; myTool.LineNumber = 1 ; myTool.DrawingType = DRAWING_STATIONARY_TEXT; myTool.TextAlignment = DT_CENTER; myTool.FontFace = "ARIAL"; myTool.FontSize = 10; myTool.FontBold = true; myTool.BeginDateTime = sc.Index; myTool.BeginValue = sc.High[sc.Index]; myTool.Color = RGB(255,0,0); myTool.AddMethod = UTAM_ADD_OR_ADJUST; sc.UseTool(myTool); } |
[2020-10-09 08:45:17] |
gfx2trade - Posts: 48 |
Never mind. I could succeed with s_UseTool Tool;
int UniqueLineNumber = 74191;//any random number. SCString myText; Tool.Clear(); // Reset tool structure. Good practice but unnecessary in this case. Tool.ChartNumber = sc.ChartNumber; Tool.Text = myText.Format(" (%f)", (sc.High[sc.Index] - sc.Low[sc.Index]) / sc.TickSize);; Tool.DrawingType = DRAWING_STATIONARY_TEXT; Tool.LineNumber = UniqueLineNumber +1; Tool.TextAlignment = DT_CENTER; Tool.FontFace = "ARIAL"; Tool.FontSize = 10; Tool.FontBold = true; Tool.BeginDateTime = sc.BaseDateTimeIn[sc.Index]; Tool.BeginValue = sc.High[sc.Index] + 10 * sc.TickSize; Tool.Color = RGB(0,200,200); Tool.AddMethod = UTAM_ADD_OR_ADJUST; sc.UseTool(Tool); |
[2020-10-09 08:45:28] |
gfx2trade - Posts: 48 |
you can close ticket
|
To post a message in this thread, you need to log in with your Sierra Chart account: