OmniTrader Forum OmniTrader Forum
forums calendars search
today this week
 
register logon control panel Forum Rules
You are currently browsing as a guest.
You should logon to access more features
A Self-Moderated Community - ALL MEMBERS, PLEASE READ!
Vote for Members who contribute the most to your trading, and help us moderate content within the Forums.


  Current location        Thread information  
OmniTrader 2016 Forums
OmniTrader 2017 General Discussion
AutoTrade problems/questions
Last Activity 5/11/2018 3:43 PM
36 replies, 1538 viewings

Jump to page : 1 2
Now viewing page 1 [25 messages per page]
 
back reply
Printer friendly version

^ Top
Steve Luerman

Veteran
100100
Posts: 208

Joined: 8/19/2005
Location: Boulder, CO

User Profile
 
Subject : AutoTrade problems/questions
Posted : 6/26/2017 4:40 PM
Post #41177

I've been using AutoTrade to do EOD MOC orders for most of June, and have been able to monitor its behavior most days. I've noticed several things that I see as problems. Are they due to an error on my part, a misunderstanding of how AutoTrade works, or a problem with AutoTrade? A couple weeks ago, I started keeping a detailed log (and adding more detail as time goes by).

AutoTrade Configuration (Note: These times are Mountain Time zone):


Problem 1:
Each of the past Monday's, AutoTrade did not start at its configured time (1:35pm). So at 1:36pm, I had to manually start the ToDoList analysis (and then I also manually entered the trades). Each weekend, I had shutdown OT, and had restated OT either on Sunday or on Monday prior to the scheduled AutoTrade start time, and enabled AutoTrade with the configuration shown in the snapshot above. Tuesday thru Friday last week, AutoTrade started as configured. But each of the past two Monday's have been a problem. I'll continue monitoring, but the only unusual aspect I can think of is that I have shutdown OT over the weekend, and restarted it, and probably have not run analysis since restarting and enabling AutoTrade.

Questions:
After enabling AutoTrade, does it need to be "primed"? Does the ToDoList need to be run manually before AutoTrade will start on its own? Or is there something unique about Monday?

Problem 2:
As I mentioned, I'm using AutoTrade to place MOC entry orders. My experience was that AutoTrade would not place new orders until existing positions were closed. So, in order to enable reuse of funds, I'm using MKT orders for exits, and MOC orders for entries.
I'm running a set of RTM strategies. Frequently a symbol will have multiple strategies with signals. For these symbols with multiple strategies with active signals, sometimes (it may be every time -
longer term monitoring will clarify this) as soon as the closing MKT order has been issued/executed, another opening trade is automatically placed by OT for that symbol. The quantity is always less by a random (or so it seems) amount, and the type of trade Long/Short is random (although usually in the same direction as the original position). Luckily, I've been able to monitor AutoTrade, and can immediately close these new/incorrect trades.

Example 1:
2017-06-14 AAL had a T3 Buy signal and MOC 1718 sh trade entered.
NOTE: Post-market analysis, the signal was gone.
2017-06-15 AAL again had a signal MVX-15 and T3. Position already established the prior day, so no change.
2017-06-19 Both T3 and MVX-15 signaled exits. MKT order issued for exit during analysis. Then immediately, a new BUY 1500 sh MKT order was issued by OT, which I manually exited.

Example 2:
2017-06-15 TXN had a T3 Buy signal and MOC 1027 sh trade entered.
2017-06-19 T3 signaled an exit. But, also XLS-19 also now shows an active signal (since 2017-06-16) which is also signalling an exit. MKT order issued for exit during analysis. Then immediately, a new BUY 827 sh MKT order was issued by OT, which I manually exited.

Example 3 (very strange SHORT):
2017-06-13 CTRP had CTX-1 and MS-16 Buy signals and MOC 1538 sh trade entered.
2017-06-15 CTRP had an additional T3 Buy signal. No new order.
2017-06-19 All 3 strategies signaled exits, but didn't show up until post-market analysis so still in long trade.
2017-06-20 AutoTrade started as configured at 1:35pm and issued MKT 1538 sh exit order during analysis. Immediately, a new SHORT MKT 1038 sh order was automatically issued by OT, which I immediately terminated with a closing Buy order.

I can provide more examples, but this gives you a flavor of the sort of things I'm seeing. Any ideas about what might be happening?


[Edited by Steve Luerman on 6/26/2017 4:41 PM]

Attached file : 2017-06-26_14-26-25.png (15KB - 429 downloads)

^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 6/27/2017 10:35 AM
Post #41180 - In reply to #41177

Problem 1: After enabling AutoTrade, does it need to be "primed"? Does the ToDoList need to be run manually before AutoTrade will start on its own? Or is there something unique about Monday?


From what I can tell, there's something unique about Monday. It's an issue I've been working with development on. The difficulty is that it only occurs once a week. You say that with OT closed, then opened on Monday, OT still doesn't run Auto Trade? What time did you open OT on Monday & enable AT?

Problem 2:


Unfortunately signals can change sometimes in this scenario (using MoC). Check out the user guide for XLS-19 V2 under the section "Considerations when Using Market on Close Orders". It's basically just the nature of forming signals / forming exits. You run EOD analysis during the market day (which is necessary for MoC), then after market close that forming signal or exit could go away if the conditions are no longer met. Or a new signal may show up that wasn't there before.

These changing signals shouldn't happen very often if only trading XLS-19 V2, but sadly the more strategies you have running, the more you will see changing signals if you run analysis before market close.

It's important to note that once the trade plan is active, it's up to that trade plan to finish it's course before any other trades can occur for that symbol. No new trades will be taken & Auto Trade will not close the trades. So even for the cases where you get a signal that it enters a trade on, then the signal disappears, the trade plan still will manage the trade through completion.

These cases are the main reason we included the alternate choice to use the market on open version of the trade plan.

^ Top
Steve Luerman

Veteran
100100
Posts: 208

Joined: 8/19/2005
Location: Boulder, CO

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 6/27/2017 11:08 AM
Post #41181 - In reply to #41180

Hi, Barry.

PROBLEM 1:
This week, I opened OT on Sunday - here's the current log header:
Date/Time: 6/25/2017 6:46:08 AM
System: Windows 10 Pro (6.2.9200.0)
Version: 2017.0 Pre-Release 2K (2020) - 06/15/2017 @ 13:38:59
Edition: Professional Edition
--------------------------------------------------------

6/25/2017 6:46:08 AM InitOTError: 1.37
6/25/2017 6:46:08 AM InitializeVotingEngine (pre): 0.05
6/25/2017 6:46:10 AM Application Main Thread Id: Managed=1, Non-Managed=8216
6/25/2017 6:46:11 AM InitializeVotingEngine: 2.20
6/25/2017 6:46:12 AM InitError .Net (pre): 1.69


And last week, it looks like I started it also on Sunday about the same time:
Date/Time: 6/18/2017 6:44:40 AM
System: Windows 10 Pro (6.2.9200.0)
Version: 2017.0 Pre-Release 2K (2020) - 06/15/2017 @ 13:38:59
Edition: Professional Edition
--------------------------------------------------------

6/18/2017 6:44:40 AM InitOTError: 0.20
6/18/2017 6:44:40 AM InitializeVotingEngine (pre): 0.01
6/18/2017 6:44:40 AM Application Main Thread Id: Managed=1, Non-Managed=7488
6/18/2017 6:44:40 AM InitializeVotingEngine: 0.16


So, in both cases, I started on Sunday morning.

PROBLEM 2:
I understand signals can change. That's not the issue the issue I was trying to highlight.

And, the tradeplan, once active, is finishing the trade. That's working as I expect.

BUT, the problem is that SOMETHING (I'm pointing my finger at AutoTrade) is re-entering the trade after the inital tradeplan has exited the trade. It seems to only occur when there are multiple strategies that have signaled at the same time as the initial strategy entry, or since then. But ALL of these strategies have now signaled an exit. So, I don't understand why a new position is being entered as soon as the initial trade exits. Occasionally, the new position has been a SHORT (no short has been signaled). Usually, the new position is LONG (like the original trade. But this happening after ALL strategies have signaled an exit. There is no new entry signal.

I will be going back to OmniPilot for now. I think there is a problem using AutoTrade with multiple strategies for MOC orders. I've never tried using OP with MOC, so I may encounter the same problem. We'll see.

[Edited by Steve Luerman on 6/27/2017 11:10 AM]

^ Top
Steve Luerman

Veteran
100100
Posts: 208

Joined: 8/19/2005
Location: Boulder, CO

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 6/27/2017 11:14 AM
Post #41182 - In reply to #41180

Ooops. Forgot to comment on when I started AutoTrade:

The log shows when OT was started, but not when AutoTrade is enabled. I'm very sure this past week that I enabled AutoTrade immediately after starting OT on Sunday. For the prior week, I don't know exactly when I started AutoTrade. I think it was on Monday. But it was prior to the time AutoTrade was supposed to start.
^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 6/27/2017 11:27 AM
Post #41183 - In reply to #41181

Regarding problem 1, please try starting OT on Monday morning next week to see if it makes a difference.
^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 6/27/2017 11:31 AM
Post #41184 - In reply to #41183

Regarding problem 2, please post your recent Auto Trade log files since 6-15. they reside in ...Nirvana/OT2017/Brokerage/logs. You can put them in a zip file to make it easier to attach.

Also I see you're reverting to Pilot, that's fine. If you try again on Monday, let me know.

^ Top
Steve Luerman

Veteran
100100
Posts: 208

Joined: 8/19/2005
Location: Boulder, CO

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 6/27/2017 11:46 AM
Post #41185 - In reply to #41184

Barry,
I've sent you the logs.

I’ll continue using AutoTrade for a while. For the near term, I should be able to monitor it daily in the hour before market close.

Which would be a better test? Leave it running through next Monday? Or stop it after market close on Friday, and restart it on Monday morning?

[Edited by Steve Luerman on 6/27/2017 11:47 AM]

^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 6/27/2017 11:53 AM
Post #41187 - In reply to #41185

The better test would be to open OT Monday morning. Whether it's open or not during the weekend doesn't matter. My theory is this will work & that if OT is running from Sun to Mon it will not work. I already know that leaving it running from Fri to Mon exhibits the problem.
^ Top
Steve Luerman

Veteran
100100
Posts: 208

Joined: 8/19/2005
Location: Boulder, CO

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/8/2017 9:54 AM
Post #41220 - In reply to #41185

Barry and I have exchanged a lot of emails since I started this tread. I described two problems in this thread:

Problem 1: Starting OT and AutoTrade on Sunday, or leaving it running over a holiday (e.g. July 4th) is a problem. The next day (e.g. Monday or Wednesday this past week), AutoTrade does not start the ToDoList processing.

Status: My understanding is that it is being studied for a solution by Nirvana.

Workaround: Start OT and AutoTrade on Monday morning, and the morning after a holiday.


Problem 2: Trades were being exited as designed, but then re-entered the trade immediately (within a second or two). I pointed to AutoTrade as the source of the re-entry trades.

Status: Previously, I had OT connected thru IB Gateway, and was monitoring trade execution with a second IB login using TWS on a different PC. On Friday, I changed OT to connect thru GXTrader (but continued to monitor trade execution with TWS). The "re-entry trades" did not occur (sample of 2 - so not conclusive because the "re-entry" problem did not previously occur in 100% of trade exits, although did occur in most). It will require more trade exits to know for sure, but I am hopeful this has resolved the problem. If this does resolve the problem, it is still unclear what was causing the re-entry trades.

I'll update when there is more to report.

^ Top
Steve Luerman

Veteran
100100
Posts: 208

Joined: 8/19/2005
Location: Boulder, CO

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/11/2017 3:00 PM
Post #41237 - In reply to #41220

Problem 1: OT/AutoTrade has to be started on Monday and on the day following a holiday, otherwise it will not start as scheduled.
Status: Barry reports that problem has been fixed. I assume/hope it will be in the next pre-release.

Problem 2: Re-entry trades...
Status: As I reported in last post, I've switched from IBGateway to GXTrader. Again today (like I reported on Friday), all exits were done correctly without any "re-entry" trades being mysteriously submitted. I am sticking with GXTrader.

NOTE: The source of the "re-entry" trades is still a mystery. Barry says he'll be continuing to look into this problem with IBGateway.

[Edited by Steve Luerman on 7/11/2017 3:03 PM]

^ Top
John J

Veteran
100100
Posts: 215

Joined: 8/3/2010
Location: Leduc, AB

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 2:38 AM
Post #41270 - In reply to #41177

Hi Barry,

Done some testing with a CRSI MOC tradeplan in RT (5M). Autotrade will enter orders, but the orders are never filled. PR2L didn't seem to address this.
^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 9:35 AM
Post #41271 - In reply to #41270

John, if Auto Trade is submitting the orders, it's doing it's intended function. If trades aren't getting filled that would be something else. So if you manually place trades with the same trade plan, it should behave the same way.

Can you attach your trade plan? Are you trading to paper or a broker? What time is your Auto Trade submitting orders?

^ Top
John J

Veteran
100100
Posts: 215

Joined: 8/3/2010
Location: Leduc, AB

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 11:41 AM
Post #41272 - In reply to #41177

Hi Barry,

This is the CRSI tradeplan created by Nirv. Only difference is that the order type was changed from MOO to MOC (see attached). I'm trading the ES Emini futures contract, so the strat is set to trade around the clock in a paper account.

The screenshot shows an order entered by the tradeplan on the 10:10 bar this morning. This order should have been filled by the time the 10:15 or 10:20 bar rolls around, but it didn't.

I should also mention that I have both Forming and New signal types checked in the Autotrade settings. The order in question was triggered by a Forming signal on the 10:10 bar. On 10:15 this is converted to a New signal which subsequently triggers an email saying;

"AutoTrade failed; Account: RT Futures, Symbol: ESU7, Tradeplan: (Strategy), Error: An open order exists for symbol 'ESU7'. Cancel all open orders first!."

The email is obviously in accordance with the new PR2L, but MOC orders didn't get filled prior to that either. Anyhow, the order should have been filled by the time the New signal was created in this case, right?




[Edited by John J on 7/26/2017 12:29 PM]

Attached file : CaptureA.JPG (48KB - 322 downloads)
Attached file : CRSI MOC.ott (96KB - 32 downloads)

^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 12:45 PM
Post #41273 - In reply to #41272

Thanks for the details, John. Trading futures with MoC isn't something I'm familiar with. Is that even possible with a broker? If so, given that ES trades round the clock, when does the broker decide when the close is? It's likely OT paper doesn't know when the close is since it's a 24 hour trade session.
^ Top
John J

Veteran
100100
Posts: 215

Joined: 8/3/2010
Location: Leduc, AB

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 1:08 PM
Post #41274 - In reply to #41177

Hi Barry,

Since this is a RT profile, MOC should for all purposes be the equivalent of "Bar on Close"? Below screenshot confirms it. It shows that roughly 9 trades were opened and closed by OT since 7am this morning. However, Autotrade was unable to trade any of them in my paper account.

Bottom line, if OT internals is able to execute the tradeplan, then Autotrade should be able to replicate it, right?

(I have reported in the VT forum that I can't get Xenith to work in VT, so I can't very if the problem exists in the Throttle as well?)



[Edited by John J on 7/26/2017 1:25 PM]

Attached file : CaptureA.JPG (185KB - 295 downloads)

^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 1:20 PM
Post #41275 - In reply to #41274

A MOC order is an order that will be executed at or just after the close. I have yet to try it, so I'm guessing here. But in this case, the market doesn't close, so the trade doesn't execute. There is no bar on close order type. It sounds like you want market orders if you want all 9 of those trades to be traded.
^ Top
John J

Veteran
100100
Posts: 215

Joined: 8/3/2010
Location: Leduc, AB

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 1:37 PM
Post #41276 - In reply to #41177

Hi Barry,

The next screenshot clearly shows that a MOC order was placed on the 12:00 5M bar. So, OT internals definitely treats it as a "Bar on Close" order. If this is not by design, then I think we have a major problem if it can't be replicated in the Autotrader as well?






[Edited by John J on 7/26/2017 1:38 PM]

Attached file : CaptureA.JPG (121KB - 283 downloads)

^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 1:38 PM
Post #41277 - In reply to #41275

I did find that MoC behaves differently, & incorrectly, when backtesting on intraday timeframes. In OT backtesting it's executing at the end of bar. For daily this is correct, but for intraday it isn't. I'll report this as a bug.

When trading on the right edge though, MoC looks like it behaves correctly & waits until the actual close of market to execute. Again, in the case of futures, I'm not sure how this is handled at a broker, but I'm pretty sure OT Paper just doesn't know when to execute it since the market doesn't close.

Just to be clear though, when we do get a fix for backtesting MoC on intraday bars, the correct fix will be to not allow the trade to execute until market close, so you would only see one trade per day on a 5 minute bar. In the case of futures, that still may never execute.

^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 1:48 PM
Post #41278 - In reply to #41277

I did a little searching & it doesn't look like MoC orders are allowed with futures at brokers or the exchanges.
^ Top
John J

Veteran
100100
Posts: 215

Joined: 8/3/2010
Location: Leduc, AB

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 1:48 PM
Post #41279 - In reply to #41277

Thanks Barry,

See my post above (posted a minute before your 2nd. latest post).

Yes, I think it's a bug as well. Definitely a discrepancy between OT internals and trades opened by Autorader (which never fills).

I'll switch back to MOO in case the broker wont accept MOC order (I'm going to verify this with IB).

[Edited by John J on 7/26/2017 1:58 PM]

^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 1:55 PM
Post #41280 - In reply to #41279

Yes, I got it, thanks.

Just to be clear though, when we do get a fix for backtesting MoC on intraday bars, the correct fix will be to not allow the trade to execute until market close, so you would only see one trade per day on a 5 minute bar. In the case of futures, that still may never execute.

I tried to place MoC directly in TWS on ESU7. It isn't allowed. MoC isn't a selectable order type.

^ Top
John J

Veteran
100100
Posts: 215

Joined: 8/3/2010
Location: Leduc, AB

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 2:05 PM
Post #41281 - In reply to #41177

Thanks again Barry,

Nirv already has a BoC (Bar on Open) order type implemented. Perhaps a BoC (Bar on Close) type order needs to be implemented as well? In this case we don't have to deal with the ambiguity MoC causes when applied to intraday trading?

Previous discussions regarding XLS-19 etc. has confirmed that MOC orders are more profitable than MOO orders. I have verified it to be true in intraday trading as well, at least with the strat I'm using here...

[Edited by John J on 7/26/2017 2:11 PM]

^ Top
Barry Cohen

Sage
500010010010025
Posts: 5332

Joined: 1/19/2004

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 2:09 PM
Post #41282 - In reply to #41281

Well, there won't be this ambiguity when MoC works properly on the intraday timeframe's voteline, right?
^ Top
John J

Veteran
100100
Posts: 215

Joined: 8/3/2010
Location: Leduc, AB

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 2:17 PM
Post #41283 - In reply to #41177

Hi Barry,

What shows on the voteline is of no use to me if Autotrade can't execute those trades. Many of those trades appear in the middle of the night etc.

[Edited by John J on 7/26/2017 2:19 PM]

^ Top
John J

Veteran
100100
Posts: 215

Joined: 8/3/2010
Location: Leduc, AB

User Profile
 
Subject : RE: AutoTrade problems/questions
Posted : 7/26/2017 3:21 PM
Post #41284 - In reply to #41177

Hi Barry,

We touched upon some of these issues in the VT forum last year;

https://www.visualtrader.com/visualtrader/forum/thread-view.asp?threadid=3593

It was stated that "MOO waits until the next morning's bar on intraday timeframes while BOO gets in on the next intraday bar". I have confirmed this statement to be incorrect as far as the voteline. Intraday MOO and BOO orders may be treated differently in Autotrader/Throttle, but they are definitely equivalent on the voteline. You guys have to keep this in mind if you are going to restrict MOC to EOD profiles...


[Edited by John J on 7/26/2017 3:36 PM]

Jump to page : 1 2
Now viewing page 1 [25 messages per page]
back reply

Legend    Action      Notification  
Administrator
Forum Moderator
Registered User
Unregistered User
E-Mail this thread to a friend
Toggle e-mail notification


Nirvana Systems
For any problems or issues please contact our Webmaster at webmaster@nirvsys.com.