Simple Coding Help - No Promise.

I am backtesting a strategy on a list of 100 stocks and max open position is defined as 1. If there are simultaneous buy signals on a particular bar, which stock will be chosen? Is it alphabetical ? Will be grateful for guidance
As per this KB Article: Symbol selection when PositionScore is not defined.

If PositionScore is not defined or it has the same value for two or more symbols, then AmiBroker will use the following rules:
  1. Transaction with greater PositionSize is preferred – the comparison method depends on the position sizing approach used in our code:
    • If we use SetPositionSize( dollarvalue, spsValue) – then $ value is compared.
    • If we use SetPositionSize( shares, spsShares) – then number of shares is used for comparison.
    • If we use SetPositionSize( perc, spsPercentOfEquity) – then % equity matters.
  2. Alphabetical order
  3. Long trades rather than short trades, if both occur at the same time for the same symbol.
 
As per this KB Article: Symbol selection when PositionScore is not defined.

If PositionScore is not defined or it has the same value for two or more symbols, then AmiBroker will use the following rules:
  1. Transaction with greater PositionSize is preferred – the comparison method depends on the position sizing approach used in our code:
    • If we use SetPositionSize( dollarvalue, spsValue) – then $ value is compared.
    • If we use SetPositionSize( shares, spsShares) – then number of shares is used for comparison.
    • If we use SetPositionSize( perc, spsPercentOfEquity) – then % equity matters.
  2. Alphabetical order
  3. Long trades rather than short trades, if both occur at the same time for the same symbol.
thanks a lot...information has really helped me...
 
.
 

Similar threads

Broker Special Offers

Zerodha – Open Paperless Account

Open online account with Zerodha. Free delivery trading and Max Rs 20 for Intraday, F&O, Currency and Commodity Trading. Intraday High leverage with MIS, CO and BO.

Name:Phone:
Email:City:
State:
Are you a day trader?