This script has Automatic Instrument Context by default. This means, when this script section executes, it is given direct access to all IPV Properties and Functions.
Called once for each instrument which has an existing position after the Initialize Risk Management script has been called, the Compute Instrument Risk script can be used to compute per-instrument risk and to total the risk at the portfolio level.
The Total Risk Limiter block uses this script to add up the risk for each instrument:
' Add the instrument risk to the total risk.
totalRisk = totalRisk + instrument.currentPositionRisk
Edit Time: 9/12/2020 10:28:44 AM |
Topic ID#: 215 |