API Objects properties constants: Difference between revisions

From NakedMarkets
Jump to navigation Jump to search
Created page with "=== Summary === The Object type constants are used in graphical objects functions to set the property of the object <br> === Definition === {| class=wikitable cellpadding="10..."
 
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
=== Summary ===
=== Summary ===


The Object type constants are used in graphical objects functions to set the property of the object
The Object properties constants are used in graphical objects functions to set the property of the object
<br>
<br>
=== Definition ===
=== Definition ===
{| class=wikitable cellpadding="10" style="border-style: solid; border-width: 2px"
{| class=wikitable cellpadding="10" style="border-style: solid; border-width: 2px"
|-  
|-  
! Constant name !! Value || Type
! Constant name !! Description || Type
|-
|-
| '''OBJPROP_TIME1''' || Datetime value to set/get first coordinate time part (X-Axis) || DateTime
| '''ObjectProperty.OBJPROP_TIME1''' || Datetime value to set/get first coordinate time part (X1) || [https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-7.0 DateTime]
|-
|-
| '''OBJPROP_PRICE1''' || Double value to set/get first coordinate price part (Y-Axis) || Double
| '''ObjectProperty.OBJPROP_PRICE1''' || Double value to set/get first coordinate price part (Y1) || [https://learn.microsoft.com/en-us/dotnet/api/system.double?view=net-7.0 Double]
|-
|-
| '''OBJPROP_TIME2''' || Datetime value to set/get second coordinate time part (X-Axis) || DateTime
| '''ObjectProperty.OBJPROP_TIME2''' || Datetime value to set/get second coordinate time part (X2) || [https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-7.0 DateTime]
|-
|-
| '''OBJPROP_PRICE2''' || Trend Line
| '''ObjectProperty.OBJPROP_PRICE2''' || Double value to set/get second coordinate price part (Y2) || [https://learn.microsoft.com/en-us/dotnet/api/system.double?view=net-7.0 Double]
|-
|-
| '''OBJPROP_TIME3''' || Fibonacci Retracement
| '''ObjectProperty.OBJPROP_TIME3''' || Datetime value to set/get third coordinate time part (X3) || [https://learn.microsoft.com/en-us/dotnet/api/system.datetime?view=net-7.0 DateTime]
|-
|-
| '''OBJPROP_PRICE3''' || Text
| '''ObjectProperty.OBJPROP_PRICE3''' || Double value to set/get third coordinate price part (Y3) || [https://learn.microsoft.com/en-us/dotnet/api/system.double?view=net-7.0 Double]
|-
|-
| '''OBJPROP_COLOR''' || Label
| '''ObjectProperty.OBJPROP_COLOR''' || Color value to set/get object color || [https://learn.microsoft.com/en-us/dotnet/api/system.drawing.color?view=net-7.0 Color]
|-
|-
| '''OBJPROP_STYLE''' || Rectangle
| '''ObjectProperty.OBJPROP_STYLE''' || Value is one of STYLE_SOLID, STYLE_DASH, STYLE_DOT, STYLE_DASHDOT, STYLE_DASHDOTDOT constants to set/get object line style || [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types int]
|-
|-
| '''OBJPROP_WIDTH''' || Ellipse
| '''ObjectProperty.OBJPROP_WIDTH''' || integer value to set/get object line width || [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types int]
|-
|-
| '''OBJPROP_FIBOLEVELS''' || Triangle
| '''ObjectProperty.OBJPROP_FONTSIZE''' || Integer value to set/get font size for text objects || [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types int]
|-
|-
| '''OBJPROP_LEVELCOLOR''' || Thumbs up
| '''ObjectProperty.OBJPROP_LOCKED''' || Boolean value to set/get the 'locked' property for graph objects. The 'locked' property is the same as the Tradingview one, activating/deactivating the edition of the graph object. || [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool bool]
|-
|-
| '''OBJPROP_LEVELSTYLE''' || Thumbs down
| '''ObjectProperty.OBJPROP_SELECTABLE''' || Boolean value to set/get the 'selectable' property for graph objects. This property activate/deactivate the selection of the graph object. <u>Beware</u> : if the graph object 'selectable' property is set to 'false', it's no longer possible to select the objet other than programmatically. || [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool bool]
|-
| '''OBJPROP_LEVELWIDTH''' || Arrow Up
|-
| '''OBJPROP_FONTSIZE''' || Arrow down
|}
|}
=== Examples ===
=== Examples ===
C# code snippet :
<code>
<br>// Add 6 hours to the Current Date
<br>DateTime SessionStart = new DateTime(CurrentDate.Year, CurrentDate.Month, CurrentDate.Day).AddHours(6);
<br>// Create a Rectangle with name "RectangleExample" and empty coordinates
<br>ObjectCreate("RectangleExample", ObjectType.OBJ_RECTANGLE, DateTime.MinValue, 0, DateTime.MinValue, 0);
<br>// Set the X1 Value (OBJPROP_TIME1) to the SessionStart variable
<br>ObjectSet("RectangleExample", ObjectProperty.OBJPROP_TIME1, SessionStart);</code>

Latest revision as of 08:12, 5 September 2025

Summary

The Object properties constants are used in graphical objects functions to set the property of the object

Definition

Constant name Description Type
ObjectProperty.OBJPROP_TIME1 Datetime value to set/get first coordinate time part (X1) DateTime
ObjectProperty.OBJPROP_PRICE1 Double value to set/get first coordinate price part (Y1) Double
ObjectProperty.OBJPROP_TIME2 Datetime value to set/get second coordinate time part (X2) DateTime
ObjectProperty.OBJPROP_PRICE2 Double value to set/get second coordinate price part (Y2) Double
ObjectProperty.OBJPROP_TIME3 Datetime value to set/get third coordinate time part (X3) DateTime
ObjectProperty.OBJPROP_PRICE3 Double value to set/get third coordinate price part (Y3) Double
ObjectProperty.OBJPROP_COLOR Color value to set/get object color Color
ObjectProperty.OBJPROP_STYLE Value is one of STYLE_SOLID, STYLE_DASH, STYLE_DOT, STYLE_DASHDOT, STYLE_DASHDOTDOT constants to set/get object line style int
ObjectProperty.OBJPROP_WIDTH integer value to set/get object line width int
ObjectProperty.OBJPROP_FONTSIZE Integer value to set/get font size for text objects int
ObjectProperty.OBJPROP_LOCKED Boolean value to set/get the 'locked' property for graph objects. The 'locked' property is the same as the Tradingview one, activating/deactivating the edition of the graph object. bool
ObjectProperty.OBJPROP_SELECTABLE Boolean value to set/get the 'selectable' property for graph objects. This property activate/deactivate the selection of the graph object. Beware : if the graph object 'selectable' property is set to 'false', it's no longer possible to select the objet other than programmatically. bool

Examples

C# code snippet :
// Add 6 hours to the Current Date
DateTime SessionStart = new DateTime(CurrentDate.Year, CurrentDate.Month, CurrentDate.Day).AddHours(6);
// Create a Rectangle with name "RectangleExample" and empty coordinates
ObjectCreate("RectangleExample", ObjectType.OBJ_RECTANGLE, DateTime.MinValue, 0, DateTime.MinValue, 0);
// Set the X1 Value (OBJPROP_TIME1) to the SessionStart variable
ObjectSet("RectangleExample", ObjectProperty.OBJPROP_TIME1, SessionStart);