Login Page - Create Account

Support Board


Date/Time: Sat, 26 Nov 2022 23:18:51 +0000



Post From: CANGE BAR COLOR IN SIERRA TREND

[2013-05-24 17:57:41]
Sierra Chart Engineering - Posts: 104293
Here is the source code for it:

#include "sierrachart.h"
//DEVELOPED BY TCAST
//tcast@charter.net
//SCDLLInit("SierraTrend");


/***********************************************************************/
SCSFExport scsf_SierraTrend(SCStudyGraphRef sc)
{
if(sc.SetDefaults)
{
sc.GraphName="SierraTREND";
sc.StudyDescription="SierraTREND. TTM trend replica by tcast. ";

sc.Subgraph[0].Name="sierraTREND BAR";
sc.Subgraph[0].DrawStyle = DRAWSTYLE_COLORBAR;
    sc.Subgraph[0].LineWidth = 3;

    sc.Input[0].Name = "Length";
    sc.Input[0].SetInt(5);
    sc.Input[0].SetIntLimits(1, 1000);
    
    sc.FreeDLL = 0;
sc.AutoLoop = 1;
sc.GraphRegion = 0;
return;
}

int i = sc.Index;
int len = sc.Input[0].GetInt();
  const DWORD upColor = RGB(0, 0, 255);  
  const DWORD downColor = RGB(255, 0, 0);  

  sc.Subgraph[0][i]=sc.BaseDataIn[SC_LAST][i];

  if( sc.BaseData[SC_OPEN][i] >=sc.BaseData[SC_HIGH][i-len])
  {
    sc.Subgraph[0].DataColor[sc.Index] =upColor ;    
  }
  else if ( sc.BaseData[SC_OPEN][i] <=sc.BaseData[SC_LOW][i-len])
  {
    sc.Subgraph[0].DataColor[sc.Index] = downColor;    
  }
else
  {
    sc.Subgraph[0].DataColor[sc.Index] = sc.Subgraph[0].DataColor[sc.Index-1];    
  }
  
  }


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