Skip to main content Skip to footer
How to Calculate a Current Bar Price Using a Price Type from Inputs

 

Calculating the current bar price using a specified price type from input parameters involves defining an input parameter for the price type and then using it to determine the current bar price. Here are the steps to achieve this:

 

Step 1: Create an Input Parameter and Set Its Default Value
Define the Input Parameter for Price Type:

  • Properties:

    • Type: Price type

    • Name: Price Type

    • Code: PriceType

    • Description: Add description

    • Default Value: Close

 

Step 2: Calculate the Current Price Using a Price Type from Settings
Define the Variable to Calculate the Current Price:

  • Properties:

    • Name: Current Price

    • Code: currentPrice

    • Value: Bar price

    • Price Type: PriceType (from input parameter)

 

Conclusion

 

By following these steps, traders can dynamically calculate the current bar price based on a user-specified price type. This approach allows for flexible and adaptable trading strategies, ensuring that the strategy can respond to different price types as defined by the user 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.