SetFibonacciDescription
Syntax
SetFibonacciDescription(objectName: string, index: number, text: string): booleanParameters
Return Value
Description
Example
Last updated
SetFibonacciDescription(objectName: string, index: number, text: string): booleanLast updated
// Set description for a specific Fibonacci level
try {
const success = this.api.SetFibonacciDescription(
"MyFibo",
2,
"38.2% Retracement"
);
console.log(`Description set: ${success}`);
} catch (error) {
console.log("Error:", error.message);
}
// Set descriptions for standard Fibonacci levels
const standardLevels = [
{ index: 0, value: "0.0%" },
{ index: 1, value: "23.6%" },
{ index: 2, value: "38.2%" },
{ index: 3, value: "50.0%" },
{ index: 4, value: "61.8%" },
{ index: 5, value: "78.6%" },
{ index: 6, value: "100.0%" },
{ index: 7, value: "161.8%" },
];
try {
for (const level of standardLevels) {
this.api.SetFibonacciDescription(
"MyFibo",
level.index,
`Level ${level.value}`
);
}
} catch (error) {
console.log("Error setting levels:", error.message);
}
// Example with custom formatting
try {
const price = 1.2;
this.api.SetFibonacciDescription("MyFibo", 0, `Support Level (${price})`);
} catch (error) {
console.log("Error:", error.message);
}