@@ -253,21 +253,18 @@ def pandl_for_instrument_forecast(
253253 notional_position = _get_notional_position_for_forecast (
254254 normalised_forecast , average_notional_position = average_notional_position
255255 )
256-
257- pandl_calculator = pandlCalculationWithSRCosts (
258- price ,
256+ account_curve = pandl_for_position (
257+ notional_position = notional_position ,
258+ average_notional_position = average_notional_position ,
259259 SR_cost = SR_cost ,
260- positions = notional_position ,
261260 fx = fx ,
262261 daily_returns_volatility = daily_returns_volatility ,
263- average_position = average_notional_position ,
264262 capital = capital ,
265263 value_per_point = value_per_point ,
266264 delayfill = delayfill ,
265+ price = price ,
267266 )
268267
269- account_curve = accountCurve (pandl_calculator )
270-
271268 return account_curve
272269
273270
@@ -302,3 +299,32 @@ def _get_normalised_forecast(
302299 normalised_forecast = forecast / target_abs_forecast
303300
304301 return normalised_forecast
302+
303+
304+ def pandl_for_position (
305+ notional_position : pd .Series ,
306+ average_notional_position ,
307+ price : pd .Series ,
308+ capital : float = ARBITRARY_FORECAST_CAPITAL ,
309+ fx = arg_not_supplied ,
310+ daily_returns_volatility : pd .Series = arg_not_supplied ,
311+ SR_cost = 0.0 ,
312+ delayfill = True ,
313+ value_per_point = ARBITRARY_VALUE_OF_PRICE_POINT ,
314+ ) -> accountCurve :
315+
316+ pandl_calculator = pandlCalculationWithSRCosts (
317+ price ,
318+ SR_cost = SR_cost ,
319+ positions = notional_position ,
320+ fx = fx ,
321+ daily_returns_volatility = daily_returns_volatility ,
322+ average_position = average_notional_position ,
323+ capital = capital ,
324+ value_per_point = value_per_point ,
325+ delayfill = delayfill ,
326+ )
327+
328+ account_curve = accountCurve (pandl_calculator )
329+
330+ return account_curve
0 commit comments