Trade Control Functions

Top  Previous  Next

Usually used in the portfolio manager to allow or deny trades for the day based on some criteria. Instruments allow all trades by default at the beginning of the test. This value is not reset by the system day to day, so whatever is set here sticks until the next time it is updated.

 


 

 

AllowLongTrades

 

marks instrument to allow long trades

AllowShortTrades

 

marks instrument to allow short trades

AllowAllTrades

 

marks instrument to allow all trades

DenyLongTrades

 

marks instrument to deny long trades

DenyShortTrades

 

marks instrument to deny short trades

DenyAllTrades

 

marks instrument to deny all trades

 

If the AllowAllTrades function is used for an instrument, all trades both long and short will be processed.

If the DenyAllTrades function is used for an instrument, all trades both long and short will be denied.

 

The following functions can be used independently. They affect only one direction, not both.

If the AllowLongTrades function is used for an instrument, long trades will be processed.

If the AllowShortTrades function is used for an instrument, short trades will be processed.

If the DenyLongTrades function is used for an instrument, long trades will be denied.

If the DenyShortTrades function is used for an instrument, short trades will be denied.

 

Note: Use instrument.DenyAllTrades at the top of the Portfolio Manager block Filter Portfolio script to deny all trades by default. In this way, the code can allow trades for instruments that meet certain criteria, and the rest will be denied.