- Accounts & Connection Management
- Data Management & Analysis
- Price Monitoring
- Charting
- Trading
- Scanners
-
Builders
-
Manual Strategy Builder
- Main Concept
- Operand Component
- Algo Elements
-
Use Cases
- How to create a condition on something crossing something
- How to create an indicator based on another indicator
- How to calculate a stop loss based on indicator
- How to submit stop order based on calculated price
- How to calculate a current bar price using a price type from inputs
- How to Use a Closed Bar Price
- Automatic Strategy Builder
-
Manual Strategy Builder
- Autotrading
- FinScript
- Trade Analysis
- Media Feeds
- Logs & Notifications
- UI & UX
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.
- Accounts & Connection Management
- Data Management & Analysis
- Price Monitoring
- Charting
- Trading
- Scanners
-
Builders
-
Manual Strategy Builder
- Main Concept
- Operand Component
- Algo Elements
-
Use Cases
- How to create a condition on something crossing something
- How to create an indicator based on another indicator
- How to calculate a stop loss based on indicator
- How to submit stop order based on calculated price
- How to calculate a current bar price using a price type from inputs
- How to Use a Closed Bar Price
- Automatic Strategy Builder
-
Manual Strategy Builder
- Autotrading
- FinScript
- Trade Analysis
- Media Feeds
- Logs & Notifications
- UI & UX