Current location | Thread information | |
![]() ![]() ![]() ![]() ![]() ![]() |
Last Activity 6/17/2025 3:19 PM 10 replies, 946 viewings |
|
|
Printer friendly version |
^ Top | |||
John W![]() Regular ![]() ![]() ![]() Posts: 96 Joined: 6/18/2011 Location: Sydney, NSW, Australia ![]() |
I recently noticed some differences in actual trades and the PortSim results. It appears that the Advisor and PortSim do not use the correct exit price when the market opens below the stop and the market then reverses and rises. The market open price is below the stop and should be used in the calcs, but instead the higher stop price is being used incorrectly. This can lead to significant errors in backtesting and ongoing profitability reporting in Port Sim. The Advisor and PortSim do work correctly where the market opens below the stop price and the market then continues to fall below the open price. In that case the market open price is correctly used for the calc. An example is shown below using the default broker Trade Plan: [Edited by John W on 5/24/2021 12:47 AM] ![]() | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Hi John Just a thot. Does your TradePlan stop use a Mkt order or BOO? And, either way, have you tried it without the Broker flag being selected? | ||
^ Top | |||
John W![]() Regular ![]() ![]() ![]() Posts: 96 Joined: 6/18/2011 Location: Sydney, NSW, Australia ![]() |
The Trade Plan uses a market order. There is no difference in result whether or not "use enabled stop as a broker stop" is selected. I've played around with this for a few hours now (honestly I don't know how Barry does this!) What I figured out is there are two alternate cases. The first case is in my earlier post - a MOC order is placed, a stop is placed below the close and the next bar opens below that stop, and the next bar then goes up. A second situation is shown below. Its the same principle but with the next bar continuing down. The Trade Advisor simulates that the trade is closed at MOC, it closes the trade on the originating MOC bar without profit or loss. [Edited by John W on 5/25/2021 2:38 AM] ![]() | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
I agree re Barry’s skill and patience. Bigtime. I didn’t notice before that the exit was attempted on the Open of the bar right after the Entry on Close of the prior bar. OT sort of has trouble with distinguishing the transition between bars. For many things it doesn’t really “know” that a bar has ended, until the next one begins. I think that may be in play here. If you’ve got the fortitude to try another test, my fingers crossed guess is that if there is a one bar or more delay between the MOC entry and an Open that crosses below a stop level, then it might work properly. If so, that piece of info should help the programmers to focus their work. To do this, make Step 2 be an NBar=1 condition that jumps to Step 3 that sets the Stop level. | ||
^ Top | |||
John W![]() Regular ![]() ![]() ![]() Posts: 96 Joined: 6/18/2011 Location: Sydney, NSW, Australia ![]() |
Thanks Jim! Using my last example, adding a 1 bar delay with the same $54.64 entry and the $54.00 stop causes the Advisor to record an exit on the open of 7/20 (second red bar $51.88), unfortunately that's a bar late. [I used "adjust entry stop based on Current bar Entry Price)". The 3 other entry stop adjustments were not appropriate.] Ideally the Advisor should record an exit on the open of 7/19 (first red bar $53.05). Hope that helps! | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Yea that’s what the example was supposed to do. I suggested it to help diagnose the issue. BARRY: please read thread details. This issue occurs ONLY when the exit triggers on the bar immediately after the MOC entry. | ||
^ Top | |||
SteveL![]() Veteran ![]() ![]() Posts: 133 Joined: 2/15/2007 Location: Boulder, CO ![]() |
John, I'm glad you found this. This is obviously a problem for PortSim results. Hopefully this can be fixed. | ||
^ Top | |||
Barry Cohen![]() Idol ![]() ![]() ![]() ![]() Posts: 2309 Joined: 1/1/1900 ![]() |
Sorry I'm just now getting to this. It's been pretty hectic with VT lately. John, can attach that "0 Example Stop error" strategy? | ||
^ Top | |||
John W![]() Regular ![]() ![]() ![]() Posts: 96 Joined: 6/18/2011 Location: Sydney, NSW, Australia ![]() |
Barry, the simple strategy is attached. Its set for the second example, you need to tweak the filter and TP to reset the strategy for the first example. ![]() | ||
^ Top | |||
Barry Cohen![]() Idol ![]() ![]() ![]() ![]() Posts: 2309 Joined: 1/1/1900 ![]() |
Thanks, so the issue looks to me like a very specific case when the entry is a MoC order & the next bar exits the trade. I'll report it. It seems to work correctly if the entry is a Market or MOO or if the Fixed Loss is based off the Current Bar Open Price instead of Entry Price. | ||
^ Top | |||
Jim Dean![]() Sage ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3433 Joined: 3/13/2006 Location: L'ville, GA ![]() |
Barry: Yup. |
|
|
Legend | Action | Notification | |||
Administrator
Forum Moderator |
Registered User
Unregistered User |
![]() |
Toggle e-mail notification |