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: 5/10/2017 8:51:26 AM
Topic ID#: 215