Skip to content

SymbolSentiment

Summary

Represents a symbol sentiment.

Signature

1
public abstract interface SymbolSentiment

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 using cAlgo.API;
 namespace cAlgo.Robots;
 [Robot(AccessRights = AccessRights.None)]
 public class Test : Robot
 {
     protected override void OnStart()
     {
         Print($"Symbol {SymbolName} traders sentiment Buy Percentage: {Symbol.Sentiment.BuyPercentage} and Sell Percentage: {Symbol.Sentiment.SellPercentage}");
     }
 }
1
2
3
4
5
6
7
8
9
 import clr
 clr.AddReference("cAlgo.API")
 from cAlgo.API import *
 class Test():
     def on_start(self):
         self.print_symbol_sentiment()
         api.Symbol.Sentiment.Updated += lambda _: self.print_symbol_sentiment()
     def print_symbol_sentiment(self):
         print(f"Symbol {api.SymbolName} traders sentiment Buy Percentage: {api.Symbol.Sentiment.BuyPercentage} and Sell Percentage: {api.Symbol.Sentiment.SellPercentage}")

See Also

Properties

BuyPercentage

Summary

Gets buy percentage if available otherwise 0.

Signature

1
public abstract double BuyPercentage {get;}

Return Value

double

SellPercentage

Summary

Gets sell percentage if available otherwise 0.

Signature

1
public abstract double SellPercentage {get;}

Return Value

double

Events

Updated

Summary

Occurs when symbol sentiment data is updated.

Signature

1
public abstract event Action<SymbolSentimentUpdatedEventArgs> Updated;