"Symbol capital exceeded - includes pending" rejection error when placing some orders.

jo988262jo988262 Posts: 8
edited September 2017 in Support

I'm not really sure what the backtester is trying to tell me with this one. I only have three symbols in my Symbol Universe, and I seem to get this error message whenever I try to place a single buy order using more than 33% of my total portfolio, even if it's all cash.

I have also verified that this occurs when there are no consequent pending orders - thought that might be the case with the "includes pending" part.

Is there any documentation that describes what this problem entails? Couldn't find any help yet.

Comments

  • jo988262jo988262 Posts: 8
    edited September 2017

    Here is the relevant code:

    self.tqqq_exposure = 0.25
    account_value = account.buying_power + account.capital_used
    target_shares = int(self.tqqq_exposure * (account_value / price.close[1]))
    current_shares = account["TQQQ"].position.shares
    if target_shares == current_shares:
        pass
    elif target_shares > current_shares:
        print "buying TQQQ " + str(target_shares - current_shares) + "@" + str(price.close[1])
        order.algo_buy('TQQQ', 
                algorithm='market', 
                intent='increase', 
                order_quantity = target_shares - current_shares,
                allow_multiple_pending = True)

    If self.tqqq_exposure is more than roughly 0.33, I get the rejection as noted in the OP. If it's less, the order goes through without a problem.

    Also, "price" is a bar object that simply holds the last minute's bars. The variable "target_shares" produces a number of shares that, when multiplied by the current price of TQQQ, equates to as close to (but no more than) 25% of my account value (when self.tqqq_exposure is 0.25).

  • jo988262jo988262 Posts: 8
    edited September 2017

    With self.tqqq_exposure set to 0.5, here's an example of the console after it has run:

    buying TQQQ 4@117.010002136

    I have my initial buying power set to $1000, and when you multiply the above two numbers together, you get about $468, as expected. So my math is correct and I easily have enough money to complete the order. This is also with TQQQ as the only symbol in universe, so that rules out that possibility.

    Yet, the order fails. I'm at a total loss.

    Decided to switch to limit orders, thinking there might be some kind of safeguard against large market orders. Nope, same issue.

    Finally, I tried using 'init' instead of 'increase'. Same issue. Running out of possibilities....

  • Sorry for using this post as a kind of diary, but could this have to do with margin? When I set my buying power as $1000, does that mean my actual margin-free capital is only $250, because I would normally be granted additional 4:1 leverage? Just spitballing.

  • If you go to Reference / Pre-trade Risk Checks, this rule (33% limit per symbol) is covered there.

  • Thank you! I briefly read that page yesterday but dismissed it when I read the first example, which used about 81% buying power on a single order, so I assumed I was seeing a bug. Glad it's a simple explanation.

Sign In or Register to comment.