POSITIONPERF

Category: ProBacktest

POSITIONPERF is a function in the ProBuilder language used to calculate the performance of trading positions in terms of percentage gain or loss. This function is particularly useful for traders and analysts to evaluate the effectiveness of their trading strategies over time.

Syntax:

PositionPerf(N)

Where N represents the index of the position for which the performance is calculated:

  • N > 0: Returns the performance of the N-th last closed position.
  • N = 0: Returns the performance of the currently open position.
  • If N is not specified, it defaults to 0, thus evaluating the current open position.

Example Usage:

positionPerformance = PositionPerf(1)

This example calculates the performance of the most recently closed position. The result, positionPerformance, will hold the ratio of gains to the cost of that position, expressed as a percentage.

Additional Information:

The POSITIONPERF function does not include brokerage fees in its calculation, which means the performance metrics are gross values. This function is essential for back-testing trading strategies to understand past performance and make informed decisions about future trades.

Understanding the output of POSITIONPERF can help in assessing the risk and return profile of trading strategies, making it a valuable tool for both novice and experienced traders in the ProRealTime trading environment.

Related Instructions:

  • STRATEGYPROFIT probacktest
  • Logo Logo
    Loading...