Skip to main content Skip to footer
How to Create a Condition on Something Crossing Something

Creating conditions based on series crossing each other is a common strategy to trigger trades. This could involve scenarios such as a price crossing an indicator, an indicator crossing another indicator, or an indicator crossing a predefined level.

 

Variant #1: Direct Usage of Indicators

 

In this variant, the condition directly checks if one indicator crosses another. For instance, the strategy can determine if a fast Simple Moving Average (SMA) crosses a slow SMA upwards.

  1. Setup Fast and Slow SMAs: Define the fast and slow SMA indicators within your strategy.

  2. Create Condition: Use the condition algo element to specify that the fast SMA crosses the slow SMA upwards.

Example: Fast SMA crossing Slow SMA up

  • Indicators: Fast SMA, Slow SMA

  • Condition: Fast SMA crosses above Slow SMA

 

Variant #2: Using Bindings

 

In this variant, bindings are used to create a more modular and reusable approach by defining members for each indicator before creating the crossing condition.

1. Create Fast MA Member

  • Define a member for the fast moving average.

Example: Fast MA Member

  • Type: Fast SMA

  • Properties: Define period and other relevant settings

 

2. Create Slow MA Member

 

  • Define a member for the slow moving average.

Example: Slow MA Member

  • Type: Slow SMA

  • Properties: Define period and other relevant settings

     

3. Create Condition

  • Use the condition algo element to check if the fast MA member crosses the slow MA member upwards.

Example: Condition Setup

  • Left Operand: Fast MA member

  • Operation: Is exactly at 

  • Right Operand: Slow MA member

Conclusion

 

By following these use cases, traders can effectively create conditions based on the crossing of different series. Whether using direct indicator comparisons or more flexible bindings, these methods allow for precise and responsive trading strategies. This flexibility ensures that strategies can be tailored to a wide range of market conditions and trading objectives 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.