Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 17:33:06 +0000



Post From: Futures tick/point values on the charts

[2024-08-13 02:27:03]
Dustin D - Posts: 2
This is what I use which shows subgraphs for Tick Size, Tick Value, and Point Value. All thanks to my amazing coding assistant Mr. ChatGPT:


#include "sierrachart.h"

// Define the name of the DLL
SCDLLName("My Creations")

SCSFExport scsf_TickSizeTickValuePointValue(SCStudyInterfaceRef sc)
{
if (sc.SetDefaults)
{
sc.GraphName = "Tick Size, Tick Value, Point Value";
sc.StudyDescription = "Displays Tick Size, Tick Value, and Point Value.";

// Define subgraphs
sc.Subgraph[0].Name = "Tick Size";
sc.Subgraph[0].DrawStyle = DRAWSTYLE_LINE;
sc.Subgraph[0].PrimaryColor = RGB(0, 0, 255); // Blue
sc.Subgraph[0].LineWidth = 2;

sc.Subgraph[1].Name = "Tick Value";
sc.Subgraph[1].DrawStyle = DRAWSTYLE_LINE;
sc.Subgraph[1].PrimaryColor = RGB(0, 255, 0); // Green
sc.Subgraph[1].LineWidth = 2;

sc.Subgraph[2].Name = "Point Value";
sc.Subgraph[2].DrawStyle = DRAWSTYLE_LINE;
sc.Subgraph[2].PrimaryColor = RGB(255, 0, 0); // Red
sc.Subgraph[2].LineWidth = 2;

sc.AutoLoop = 1; // Enable AutoLoop to process historical data correctly
return;
}

// Retrieve the Tick Size, Tick Value, and Point Value
float tickSize = sc.TickSize;
float tickValue = sc.CurrencyValuePerTick;
float pointValue = tickValue * (1.0f / tickSize);

// Plotting the values on the chart
sc.Subgraph[0][sc.Index] = tickSize;
sc.Subgraph[1][sc.Index] = tickValue;
sc.Subgraph[2][sc.Index] = pointValue;
}
Date Time Of Last Edit: 2024-08-13 02:28:09