NexusFi: Find Your Edge


Home Menu

 





SierraChart : put 2 colors in the STRING


Discussion in Sierra Chart

Updated
    1. trending_up 836 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

SierraChart : put 2 colors in the STRING

  #1 (permalink)
Mejzil
Saint-Sever + Landes/France
 
Posts: 1 since Jun 2019
Thanks Given: 0
Thanks Received: 0

Hello,
I would like to put 2 colors to a STRING of SierraChart.
I would like to put [10] in red and [16] in green in STRING.
The code works for a color on the STRING.
But I can not put 2 colors in the STRING


 
Code
#include "sierrachart.h"
#include <windows.h>
#include <string>

using std::cout;
using std::endl;
using std::string;
using std::to_string;

SCDLLName("TEST");
SCSFExport scsf_TEST(SCStudyGraphRef sc){
 
SCSubgraphRef  VBID=sc.Subgraph[0];
SCSubgraphRef  VASK=sc.Subgraph[1];

  if(sc.SetDefaults){
	  sc.GraphName="TEST";sc.FreeDLL=1;sc.AutoLoop=1;sc.GraphRegion=0;sc.UpdateAlways=1;
	  VBID.Name="BID";VBID.DrawStyle=DRAWSTYLE_CUSTOM_TEXT;VBID.PrimaryColor=RGB(255,255,255);VBID.LineWidth=10;VBID.DrawZeros=false;
	  VASK.Name="ASK";VASK.DrawStyle=DRAWSTYLE_CUSTOM_TEXT;VASK.SecondaryColor=RGB(255,0,255);VASK.LineWidth=10;VASK.DrawZeros=false;
  }

   if(sc.Index==1){
	   
	   string Stxt{};
	   
	  sc.DeleteACSChartDrawing(sc.ChartNumber,TOOL_DELETE_CHARTDRAWING,1);
	  s_UseTool AAA;
		AAA.Clear();
		AAA.ChartNumber=sc.ChartNumber;
		AAA.Region=sc.GraphRegion;
		AAA.DrawingType=DRAWING_TEXT;
		AAA.LineNumber=1;
		AAA.BeginIndex=sc.Index;
		AAA.BeginValue=sc.Low[sc.Index];
		AAA.EndIndex=sc.Index;
		AAA.EndValue=sc.Low[sc.Index];
		AAA.FontSize=VBID.LineWidth;
		AAA.AddMethod=UTAM_ADD_OR_ADJUST;
		AAA.TextAlignment=DT_CENTER;
		AAA.Color=VBID.PrimaryColor;/*<- Color for [10]:*/
		AAA.Color=VASK.SecondaryColor;/*<- Color for [16]*/
                
                Stxt="[10][16]";
		AAA.Text=Stxt.c_str();

	  sc.UseTool(AAA);

   }
}
 
Code
system ("Color 1A");/*does not work in SierraChart!*/
Can you help me ?

Reply With Quote




Last Updated on June 21, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts