Skip to main content Skip to footer

Code Actions

 

Algo elements are the most crucial and extensive part of any strategy within the Manual Strategy Builder (MSB). These elements define the actions that the strategy will perform. Algo elements are always generated for the OnBarUpdate method of the strategy, ensuring that actions are executed with each new bar update.

 

Placement of Algo Elements

 

Algo elements for the OnBarUpdate method are organized within the "Algos" tree node. This structure allows for multiple root items, which are generated sequentially in the order they are declared. Each algo element can have several outputs, leading to child algo elements, creating a dynamic and hierarchical structure.

ulti-Output Algo Elements

 

A classic example of a multi-output algo element is the "if-then" statement, which has outputs for both "true" and "false" conditions. This enables the strategy to branch based on specific criteria, enhancing its flexibility and decision-making capability.

Another example is the order submission element, which can return three states: order completed, order is still being processed, and order submission failed. This allows for comprehensive handling of different order statuses within the strategy.

Managing Algo Elements

 

Users can change the order of algo elements by dragging and dropping them within the "Algos" tree node. This functionality extends to changing the parent of an element, facilitating the reorganization of the strategy structure. Additionally, users can create copies of algo elements by dragging them to a new position while holding the Ctrl key, enabling the reuse of complex logic without the need to recreate it from scratch.

 

Conclusion

 

Algo elements form the backbone of any strategy in the MSB, dictating the actions taken during each bar update. Their hierarchical and flexible nature allows for intricate strategy development, capable of handling multiple outputs and dynamic conditions. The ability to manage, reorder, and duplicate these elements further enhances the efficiency and effectiveness of strategy creation, empowering traders to build robust and adaptable trading strategies within FinStudio.

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.