Skip to main content Skip to footer
Operand Component

 

Before exploring other elements in detail, it's important to understand the operand component. This standard component is used to describe values in various contexts, such as in member declarations and drawings. The operand's purpose is to define input values, which can have different natures and origins, making it a versatile tool in strategy development.

 

Constant Value

 

The simplest form of an operand is a constant value. This could be a number, string, date, or any fixed value like "8", "my string", or "2023/01/01". Specifying a constant value is straightforward and is often used for fixed parameters that do not change during strategy execution.

Indicator Value

 

Another way to define an operand is by using the value of an indicator. For instance, the most recent value of a Simple Moving Average (SMA) indicator, referred to as SMA[0], can be used.

Users can specify a bar index to refer to historical data points, with bar index 0 referring to the current bar, 1 to the previous bar, and so on. Additionally, indicators that rely on single series data (like SMA or Bollinger Bands) allow users to set the input type, such as Open, High, Low, Close, Median, Typical, or Weighted prices.

Bind Expression

 

Operands can also be defined by referencing other values, such as input parameters, members, or local variables. This method is useful for creating dynamic relationships between different elements of the strategy. For example, an operand can be linked to an input parameter or a member, allowing for flexible and adaptable strategy components.

Bar Price

 

An operand can be defined using bar series data, similar to indicator values. Users can specify the bar index and the type of price (Open, Close, High, or Low) they wish to use. This method is particularly useful for strategies that rely on historical price patterns or specific price points within each bar.

Market Price

 

Lastly, an operand can be defined using the current market price, which includes options for the Bid, Ask, or Last price. This method allows strategies to react to real-time market conditions effectively.

Constructing Expressions

 

Once a primary value is defined, users can construct complex expressions by adding operations. The "Add Operation" button allows for an unlimited number of operations to be added, enabling the creation of sophisticated expressions. For instance, this setup could create a complex arithmetic expression based on initial constant values and subsequent operations.

Conclusion

 

The operand component in the MSB is a versatile and powerful tool for defining values in various contexts. By understanding the different ways to represent values—whether as constants, indicator values, bind expressions, bar prices, or market prices—traders can create highly customizable and effective strategies. This flexibility in constructing expressions further enhances the MSB’s capability, allowing traders to build and fine-tune strategies with precision and ease.

Cookies Notice

We use cookies to improve your experience, personalize content, and analyze our traffic. By clicking "Accept All Cookies," you agree to the storing of cookies on your device. You can manage your cookie preferences at any time by visiting our Cookie Settings.