Two questions I've not found answers to yet:
How do you close a paper trade position manually?
Intra-day Paper trades (at least for 1 min) haven't been exiting when its the next day, how do I get them to either exit when the closing positions conditions trigger the next day or close those positions before the end of the day?
Thanks!
Size:
Color:
Let's get to the bottom of the issue instead of looking for workarounds i.e. "Close Paper Trader positions" (and name topics accordingly). So, why intraday paper trades haven't been exiting the next day? We'll need to see more details (code, message, errors etc.)
Size:
Color:
Sounds good.
This was done with no personal coding (100% Build & Backtest).
Minute scale, Paper Account 2, 50,000 starting, 10% equity.
cover at market
price >= highest price in look back period
maybe since WLP isn't always open and is shut down (overnight especially) perhaps there's a dis-association from live positions with their exit conditions?
I didn't see an error or attempts to exit the trades in the system.
Size:
Color:
Is entry at market or at stop/limit?
Size:
Color:
Entry is at Stop/Limit
Exit is at Market.
orders get stuck in a hold position with no exit.
Right now there are 5 tickers that wont exit since this morning.
I was able to get an error message in the strategy monitor, not sure if it's associated: Error(3): The given key was not present in the dictionary.
Size:
Color:
It's documented in the User Guide that there's a chance of paper trading going out-of-synch when stop/limit orders are employed whereas strategies using market orders should not be affected. You can also find explanation and an example in Cone's posts #7 and 9 here:
Paper Account Trading vs Real Account Trading
Size:
Color:
That explains why some of the Limit orders don't execute, but I'm talking about the market orders that aren't executing (I'm not worried about the limit orders not executing).
Limit to enter, and market to exit.
The orders aren't exiting. It happens to trades that are held to the end of day, those positions don't exit the next day as they should.
Size:
Color:
Let's have a look at your code first. Click "Open code in new Strategy window" and copy/paste here.
Size:
Color:
I won't be able to paste the code for that particular strategy, but I will try to re-create the error in another strategy and post within the week.
Size:
Color:
Sure, that'd be fine.
P.S. Have you upgraded to 6.9.24? There's quite a bit of Paper trading and Accounts fixes in it.
Size:
Color:
Yes 6.9.24.4,
I've not tested the strategies since the upgrade, I'll try that as well.
Size:
Color:
Thanks for looking into this. After updating WLP and getting a VPN I was able to access WLP again and finished the testing with the same results.
Paper Trade wont close with market orders. Error seems to occur when WLP turns off, and then back on, it seems to "forget" the code for closing and holds.
Providing code for two examples:
Example 1: (Limit open (not the problem), Market close (the problem))
CODE:
Please log in to see this code.
Example 2: (Market open (not the problem) Market Close (the problem))
CODE:
Please log in to see this code.
Size:
Color:
What are your data loading settings?
Just a note. If not for this condition, #1 would be problematic to execute:
CODE:
Please log in to see this code.
Size:
Color:
Since this is for live paper trading, and not a backtest, I did 1 day // 1 min scale for #1, and 7/1/2012 to 10/14/2015 // 1 min scale for #2
Size:
Color:
QUOTE:
I did 1 day // 1 min scale
I doubt this would work. Erasing the history may break the link. Try choosing at least several days of data.
QUOTE:
7/1/2012 to 10/14/2015
Dates in the past for live paper trading? It does not make any sense to me.
Size:
Color:
Perhaps I misunderstood, I did some searches but am not sure what is meant by "Data Loading settings". Could I get a screenshot or example?
Size:
Color:
This is the dropdown box where you choose "1 day" or "7/1/2012 to 10/14/2015".
Size:
Color:
I attached an image.
I don't know what is meant by erasing the history and breaking link. is the Data range associated with live trades then?
Sorry I'm really new.
I now changed both to be 20 days, Positions still wont close.
Thanks
Size:
Color:
Are you using the same time-based exit in your real strategy as in your Wizard-generated code #1? It may not be working as intended. Check out this topic for insight into the issue:
Time based exit in Rules does not work with multiple open positionsSimply put, you can fix it by replacing all references to "
LastActivePosition" in your code with "p".
Size:
Color:
okay thanks, I'll work on it.
Example 2 still won't exit, and doesn't have "Lastactiveposition".
Size:
Color:
Are you sure that the exit alerts are Auto-Staged/Placed in the Orders tool?
Is Portfolio Sync enabled in Trading Preferences?
Size:
Color:
Yes, and yes.
However I also had Exit Orders (Sell and Cover) selected, it says that having that selected could interfere with backtesting, would it also interfere with paper trading with market orders?
Size:
Color:
Given that both example strategies above employ multiple positions, looks like this setting may interfere with it.
Size:
Color: