LONGONMARKET

Category: ProBacktest

LONGONMARKET is a function in ProBuilder language used to determine if there are any open long positions in the market. This function is particularly useful for traders who need to automate their trading strategies and ensure actions are only taken when no long positions are currently held.

Syntax:

LongOnMarket

Example:

IF NOT LongOnMarket THEN
    BUY 1 LOT AT MARKET TomorrowOpen
ENDIF

This example demonstrates how to use the LongOnMarket function within a conditional statement. If there are no open long positions (as checked by NOT LongOnMarket), the script will execute a buy order of 1 lot at the market price at the opening of the next trading day.

Additional Information:

  • The LongOnMarket function returns a boolean value: TRUE if there are open long positions, and FALSE otherwise.
  • This function is crucial for strategies that require a clear entry point when no other long trades are active, helping to avoid overexposure and manage risk.
  • It is commonly used in trading systems that involve conditions or restrictions on the number of simultaneous trades.

Understanding the LongOnMarket function is essential for developing effective and safe automated trading strategies in ProBuilder language.

Related Instructions:

  • MARKET probacktest
  • ONMARKET probacktest
  • SHORTONMARKET probacktest
  • Logo Logo
    Loading...