Login Page - Create Account

Support Board


Date/Time: Mon, 06 May 2024 20:42:17 +0000



Post From: ASCIL DOM Study change Label value and ladder location on each tic

[2018-12-11 17:59:41]
User153286 - Posts: 44
I created a study that is outputting data to the Label column. It outputs the current traded price. The value does change but not its location in the DOM ladder. I am trying to get the location of the output to change on each tic. Is it possible to do on each tic? My environment is set up for tic data processing. Here is my example code....

#include "sierrachart.h"
SCDLLName("Custom Study DLL")
/*==========================================================================*/
SCSFExport scsf_DepthOfMarketData(SCStudyInterfaceRef sc) //scsf_DOMAccess
{
   SCSubgraphRef MyGraph= sc.Subgraph[0];

  if (sc.SetDefaults)
     sc.GraphName = "DOM Label example ";
     sc.StudyDescription = "DOM Label example ";
     sc.GraphRegion = 0;
     sc.AutoLoop = 0; // true
    sc.UsesMarketDepthData = 1; // access DOM data

    MyGraph.Name       = "MyGraph";
    MyGraph.PrimaryColor   = RGB(255,0,0);
    MyGraph.DrawStyle     = DRAWSTYLE_SUBGRAPH_NAME_AND_VALUE_LABELS_ONLY;
    MyGraph.LineLabel     = LL_DISPLAY_VALUE | LL_VALUE_ALIGN_DOM_LABELS_COLUMN | LL_DISPLAY_CUSTOM_VALUE_AT_Y;

    return;
  }

  // Do data processing
    int aindex = sc.ArraySize-1; //current bar index
//    MyGraph.Data[aindex] = 123;
    MyGraph.Data[aindex] = sc.Close[aindex]; //current bar value
    MyGraph.Arrays[0][aindex] = sc.Close[aindex];
}
Date Time Of Last Edit: 2018-12-11 18:00:18