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.

 

The Rank Instruments script is available in a Portfolio Manager blox type.  The Ranking Functions are for creating an order list of symbols.  

 

Ranking Values and Instrument Ranks

There are separate long and short ranking values. Ranking values are used by Trading Blox Builder to determine the relative ranking of each instrument. After the Rank Instruments script has been called for each instrument in the current Portfolio, Trading Blox Builder can sort the instruments highest to lowest using the long ranking value and then lowest to  highest using the short ranking value. It then sets the rank for each instrument based on its position after being sorted by the ranking value.

 

For long ranking values, the highest values will result in the lowest rank. So an instrument with a rank of 1 represents the instrument with the highest long ranking value for that day.

 

For short ranking values, the lowest values will result in the lowest rank. So an instrument with a rank of 1 represents the instrument with the lowest short ranking value for that day.

 

This approach lets you use a single measure for both long and short trades. For example, a strength measure would result in higher strength instrument's rated lower for long trades and lower strength instrument's rated lower for short trades.

 

Example code for the Rank Instruments script:

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

 

Links:

Trade Control Functions

See Also:

 

 

 


Edit Time: 9/13/2020 3:22:08 PM


Topic ID#: 487

 

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