This Risk Manager is used in the ADX, MACD, and Turtle built-in systems to limit the maximum number of correlated units.

 

Correlation Risk Manager Parameters:

Correlation Risk Manager Parameters

Parameter:

Description:

Max Closely Correlated Markets

Sets the max number of units the system can have on in closely correlated markets.

Maximum Loosely Correlated Markets

Sets the max number of units the system can have on in loosely correlated markets

Max Directional Units

Sets the max number of units the system can have on in each direction, Long or Short.

Correlation Risk Manager Control Logic - CAN ADD UNIT:

  '  ==============================================================
  '  Correlation Risk Mgr
  '  CAN ADD UNIT SCRIPT - START
  '  ==============================================================
  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  '  Check correlations, and total directional positions
  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  If order.position = LONG THEN
    '  LONG ORDER Correlation Filter
    If   instrument.closelyCorrelatedLongUnits >= maxCloselyCorrelatedMarkets OR
        instrument.looselyCorrelatedLongUnits >= maxLooselyCorrelatedMarkets THEN
        order.Reject( "Too many correlated long units" )
    ENDIF
    '  -----------------------------------------------------------
    '  LONG Position Count Filter
    If system.totalLongUnits >= maxDirectionalUnits THEN
        order.Reject( "Too many long directional units" )
    ENDIF
  ELSE' o.position = LONG
  '  --------------------------------------------------------------
    '  SHORT ORDER Correlation Filter
    If   instrument.closelyCorrelatedShortUnits >= maxCloselyCorrelatedMarkets OR
        instrument.looselyCorrelatedShortUnits >= maxLooselyCorrelatedMarkets THEN
        order.Reject( "Too many correlated short units" )
    ENDIF
    '  -----------------------------------------------------------
    '  SHORT Position Count Filter
    If system.totalShortUnits >= maxDirectionalUnits THEN
        order.Reject( "Too many short directional units" )
    ENDIF
  ENDIF' o.position = SHORT
  '  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  '  ==============================================================
  '  CAN ADD UNIT - END
  '  Correlation Risk Mgr
  '  ==============================================================

 


Edit Time: 9/20/2017 07:56:26 AM


Topic ID#: 123

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software