- Suppose that my Ameritrade account has no positions in any symbol. I start an automated strategy at 11Am EST (after the trading session started). I understand that the strategy would be executed on all the previous bars of the day and if it had a strategy position on some stock at the time I start it - then there is no way for it to know that the account actually has no position in the stock. When the strategy attempts to close the position, I would end up with an opposite position in my account. Is this correct?
- Somewhat similar scenario. I can an account with no positions. I start an automated strategy the night before, after the previous day trading session closed (say 9PM EST). Suppose that the strategy only places positions during trading hours. Suppose as well, that IF the strategy would have ran itself against all the previous day's bars (the day that I started it in) it would have had a position on a stock at the end of the day. The question is, would the strategy actually have a strategy position at the beginning of the next session (the following day), or would it have "known" not to run itself when i start it after the trading session?
- Same scenario, but now I start the strategy on a weekend, but had the strategy been ran on the previous Friday it would have had a position. Am i safe in this situation?
- Is there any way in the API to find out what my account position is in a symbol (rather than the strategy position?)
- Is there any way in the API to find out whether I am running live or in simulation, or against what account I am running?
Bottom line - I am trying to understand what exactly is a safe strategy deployment procedure when using NJ with TDAmeritrade such that no discrepancies occur between the strategy positions and account positions. These kinds of discrepancies can wreck the best strategies possible (as their actual actions do not match what the strategy thinks it did). For me not understanding this fully is a show stopper in using NJ for strategy automation... The tip is useful but much more detail is needed.
Comment