Login Page - Create Account

Support Board


Date/Time: Tue, 14 May 2024 06:28:45 +0000



Post From: Value not displayed on chart

[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);

}