Feature Request: Trade Settlement Preference Setting (T+3)
Author: BigReturns
Creation Date: 1/10/2014 2:49 AM
profile picture

BigReturns

#1
I haven't seen this yet, so I apologize if it already exists.

In order to make trade simulation results more accurate, it would be nice to have an option in the preferences to define the number of days for trades to settle.

Most brokerage firms, it typically takes two full business days to settle the first buy transaction. Brokers have been known to disable accounts if you buy new stock without the funds in your account or funds that haven't settled. If you have margin account, this isn't as big of a deal but since I don't have a margin account, it does affect my results.

Its not so much on the sell side as it is on the buy side in shorter length trades. If you buy stock on on the morning of day 1 with all your funds and then sell it at the end of the day, in most cases you can't buy another stock until day 3 without a margin account. It would be nice to more accurately simulate this.

Thanks
BR
profile picture

Eugene

#2
It's much easier to accomplish this straight in your Strategy's code than making such a far-reaching change to Wealth-Lab. Taking CooledOff as example and modifying it slightly to create a new T+3 function:

CODE:
Please log in to see this code.
profile picture

BigReturns

#3
Hey Eugene,

Thanks for the info. I've done this before, but its limitation is T+ only works on one instrument and not effectively across a portfolio of instruments. When you have lots of instruments and trade opportunities you need to run this vertical and horizontally (across sets of stocks). The only way that I know to do this is to keep an settlement ledger when trade order processing is performed. I can do this by hand for a a couple of stocks since its not a complicated calculation, it just gets impossible when your backtesting 7 to 10 years on 100 stocks with thousand of trades.

Just something to think about.
-Derek
profile picture

mlulmfib

#4
Hi
Is there a way to use this as the default code for the "New Strategy from Rules"
thanks in advance.
profile picture

Cone

#5
The T+3 logic needs to be in a PosSizer - reject new trades if there are insufficient funds due to settlement. Maybe yet another option for "Position Options". Eugene?

That said, note that you can turn your IRA into a Limited Margin IRA to largely avoid this settlement issue. That helps a lot, but it's still not as convenient as a real margin account. See post #6 here: https://www.wealth-lab.com/Forum/Posts/Limited-Margin-IRA-trading-33975
profile picture

Eugene

#6
QUOTE:
Maybe yet another option for "Position Options". Eugene?

I thought that you had said before that this PosSizer isn't as important anymore due to the wide availability of Limited Margin accounts?

QUOTE:
Is there a way to use this as the default code for the "New Strategy from Rules"

No.
profile picture

Cone

#7
It's true. There really isn't a reason anymore to be limited by T+3 .
profile picture

kazuna

#8
If you want to trade commission free ETFs (TLT, HYG...) or iShares non-marginable ETFs (IWM, EEM...), then it will be purchased in cash type for 30 days. In this case, T+3 rule is still applicable to the account regardless of cash or margin account.
profile picture

Eugene

#9
It wouldn't be a big deal to add the T+3 option to the PosSizer - both for those ETFs and to evaluate its effect in backtesting before Limited Margin accounts were introduced. I'm also going to fix what seems to be a minor issue in Position Options.
profile picture

Eugene

#10
@BigReturns, mlulmfib, kazuna:

Feature request satisfied. Please update extension and restart WLP. Option "T+3" is now on Position Options.
profile picture

Eugene

#11
T+2 is coming September 5 2017:

SEC Adopts T+2 Settlement Cycle for Securities Transactions

With regard to Position Options, the preferred route would be to check for trade date in the PosSizer and apply T+3 for trades before Sept. 5 2017 and use T+2 since then. This way, there's no added confusing options like T+2, T+3, (T+0 whatever). Of course this won't provide a realistic simulation for the global markets but it's a trade-off I can accept since this option was requested by U.S. customers.