Sets the long ranking value. This function is generally used by a Portfolio Manager block as part of the instrument ranking process which is one way to select instruments for trading.  However it can be used in any script as shown where an instrument has context, or it can be used in any script when used in conjunction with a BPV Instrument Type using the proceedures shown in Accessing System Portfolio Instruments


If you have three instruments in your portfolio A, B, and C.

In the Rank Instruments script you use the SetLongRankingValue function as follows:

For instrument A you set the long ranking value to 34.

For instrument B you set the long ranking value to 53

For instrument C you set the long ranking value to -12.


These will be sorted from highest to lowest.

Now in the Filter Portfolio script you can access the longRank property.

Instrument A will have a long rank of 2.

Instrument B will have a long rank of 1.

Instrument C will have a long rank of 3.



instrument.SetLongRankingValue( rankingValue )





Value used for ranking an instrument for long trades.




' Set the long ranking value for this instrument
instrument.SetLongRankingValue( rsi )


The assigned RSI value assigned is available in the instrument.longRankingValue.  It can be used as a comparison sort value to change sequential order of the instruments in the portfolio when that type of process is needed.



Accessing System Portfolio Instruments, Ranking Functions, Ranking Properties

See Also:



Edit Time: 5/26/2017 8:40:06 AM

Topic ID#: 547


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