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 Archives
OmniTrader 2013 Technical Support
Trade Calculator Bug
Last Activity 9/16/2017 11:23 AM
24 replies, 1586 viewings

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

^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : Trade Calculator Bug
Posted : 9/5/2013 11:10 AM
Post #28754

My Profile has the following parameters:

Floating Back Test period: 200 days
Floating Forward Test period: 0 days
Optimize on Monthly boundaries.
DO: On

Starting Equity: 10,000,000
Leverage: 2

Allocation Methods Enabled (No optimization)
Fixed $ Amount: 1,000,000
% of Equity: 10%
Fixed Risk: 2% (Fixed Loss Level: 2.5)

The price of the Stock in this example is 20.95 and ATR is 1.46.

Now the problem is that when in "Test Period" Tab of PortSim I select Forward (which gives no PortSim results since it is configured at 0) I get the correct quantities in the Trade Calculator (47700, 47700, 53100 respectively) BUT when I select "Backtest" or "Both" in the Test Period Tab, the Trade Calculator shows 0 quantities for all the 3 methods.
^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/5/2013 11:59 AM
Post #28756 - In reply to #28754

When I change the Back Test Period to 200 & Forward Test Period to 50 (rest of the things remaining the same), the results are even more interesting:

Fixed $ Amount: 47700,47700,47700
% of Equity: 42500,47700,47700
Fixed Risk: 12100,41500,53100

for the Back Test, Forward Test & Both "Test Periods" respectively.

^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/5/2013 12:56 PM
Post #28757 - In reply to #28756

When DO is used, the FT period should be quite large relative to the BT period, if you are studying statistics. For example, BT=250 and FT= 2500. Also note that the Boundary selection is important. Usually monthly is an appropriate starting point.

[Edited by Jim Dean on 9/6/2013 5:23 AM]

^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/5/2013 11:39 PM
Post #28761 - In reply to #28754

Jim, I understand the point you are making, but that is relevant for statistical validity of the Performance Report & Portfolio Simulation numbers. Here the question is of accuracy or otherwise of the Quantity of Shares the Trade Calculator returns. How is this related to the FT or BT period?
^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 5:22 AM
Post #28762 - In reply to #28761

I'm trying to visualize what the procedure is that you are using, and exactly what it is that you are reporting as a bug. This far the only thing that stands out is that the "Both" setting in your first post yielded zero.

The fact that the percent equity sizing changes in the portsim output when you change the BT and FT inputs, with DO active, is not surprising.

I guess I'm missing what the steps are that you are taking to tie all this in to the Trade Calculator. Normally when people talk about TC they are referring to sizes being generated for trades at the HRE. Sorry for being so dense here - maybe you could explain more pecificly what the procedure you are using to get the numbers you are posting (ie the specific steps), and, what you'd left the numbers to be and why.

Or, not. Maybe I should have stayed out of this thread since it did seem sort if unclear to me. There are a lot of folks who misunderstand how DO works - that's why I provided a comment about it.


^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 6:38 AM
Post #28763 - In reply to #28754

Although "DO' is enabled in the "Test Settings", but it is NOT being used anywhere in the present case. There is no optimization turned on anywhere in my strategy. There are no red lines around any of the blocks. Moreover as I mentioned earlier in my first post that I have turned off optimization in the Portfolio Simulation also.

So what I want is the Trade Calculator to return the quantity of shares based on the criteria I mentioned before. I know that the Test Settings which I have will give me Performance Report & Equity Curves, which has no relevance, but that is not a concern for me. I just want to know the quantity of shares. That's all.


^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 6:48 AM
Post #28764 - In reply to #28763

Okaaay. You did list DO and boundaries, so I thought that was part of the question. Now you've given us another tidbit - there is no optim in your Strat.

It is hard to follow what you are saying since you've posted no snapshots and no strategy. No one can duplicate what you are doing, as a result.

So far you mentioned nothing about using Trade Calculator at the HRE to determine a trade size. Rather, if I'm understanding your post properly, you've listed three (why just 3?) trade sizes that presumably were generated by the PortSim run.

So, maybe the problem is with PortSim, rather than the HRE trade calculator tool?

If you actually place a (paper) trade in Real (not portsim) mode at the HRE (ie dropping a chevron or clicking an enger trade button) what position size is the Trade Calculator (not portSim) giving, with what settings? And, what do you think the size is supposed to be?

And hey - Barry or anyone else - if someone understands this better than I, as to what is the problem being reported, please chime in! My guess is that the issue is with how PortSim is calculating sizes, rather than an instance of the Trade Calculator at the HRE calculating sizes. Or, maybe it's both - but so far it appears that only PortSim numbers are being discussed.

Remember - PortSim works with a different Equity starting point than Trade Calculator does (at the HRE).

[Edited by Jim Dean on 9/6/2013 6:52 AM]

^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 6:59 AM
Post #28765 - In reply to #28754

The quantity of shares I am getting which I posted earlier are at the HRE, when I drop the chevrons to enter the trade. I have not seen what quantity is being returned in the PortSim.

After testing I found these three allocation methods to be good and which I understand, so I enabled only these three methods.
^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 7:25 AM
Post #28766 - In reply to #28765

Thanks - that explains a lot more. I understand the set of three now.

But where did the NINE values in your 9/5 12:59 #28756 post come from? (Three sets of three) - that's what threw me off, thinking you were working with PS, along with discussions of BackTest and forward testing and DO.

The BT and FT and DO (should) have nothing to do with the Trade Calculator at the HRE. They have a lot to do with stats and PortSim.

The TC at the HRE uses the method you specify, with the current Account equity that is active (nothing to do with BT FT or PortSim) to calc the size of a new trade at the HRE.

Although the TC uses some similar algorithms that PS does, and quite possibly they share some subroutines - they are two different tools.

[Edited by Jim Dean on 9/6/2013 7:28 AM]

^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 8:14 AM
Post #28767 - In reply to #28754

Jim, you are right. The Trade Calculator at HRE should simply calculate the quantity of shares for each allocation method based on its criteria and the available equity (which in present case is same as starting equity).

To my mind this is a bug which needs to be fixed.
^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 8:21 AM
Post #28768 - In reply to #28767

Ok - I guess I don't get it at ALL. Please explain what the bug IS. What numbers are wrong? What should they be instead? What STEPS did you take to produce the "wrong" numbers. Although I'm not on N staff, I know that they're unlikely to be able to help if they can't Dup the problem, whatever it is.
^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 8:47 AM
Post #28769 - In reply to #28754

Thanks Jim for taking so much interest in resolving the issue. Here is how you can reproduce it:

In the ToDoList/Test Settings:
Floating Back Test period: 200 days
Floating Forward Test period: 0 days
Optimize on Monthly boundaries.
DO: On

Run ToDoList then go to PortSim.

In the PortSim (The figures are same in the Portfolio Account in the Real Mode):

Account Settings:
Starting Equity: 10,000,000
Leverage: 2
Advisor Cutoff: 50%

Trading Parameters:
Max Allocation: 20%
Min Shares: 100
Trade in Increments of: 100
Rest of the options are unchecked.

Test Period:
Try different settings and see the different results in Trade Calculator.

Simulation Constraints:
None

Trade Selection:
Symbol

Allocation Methods Enabled (No optimization)
Fixed $ Amount: 1,000,000
% of Equity: 10%
Fixed Risk: 2% (Fixed Loss Level: 2.5)

Now Run Analysis in PortSim and return to Real Mode and use Trade Calculator to reproduce the problem I mentioned.

Thank you for your patience.


[Edited by Vinay on 9/6/2013 8:49 AM]

^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 9:00 AM
Post #28770 - In reply to #28754

Incidentally if I change BT & FT periods to 250/250 instead of 200/0, only Fixed Risk method returns 0 quantity, but rest of the two methods return correct values with "Test Period" in the Portfolio Simulation Settings set at "Backtest".

It appears that the Trade Calculator quantities are somehow getting affected by the "Test Settings" in the ToDoList and "Test Period" in the Portfolio Simulation Settings. Moreover Fixed Risk is the most affected and Fixed $ Amount is the least affected method.

[Edited by Vinay on 9/6/2013 9:09 AM]

^ Top
Steve Luerman

Veteran
100252525
Posts: 185

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

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 9:08 AM
Post #28771 - In reply to #28769

Hi VXP,

Your bug sounds like, or related, to the problem that I found and reported in this thread http://www.omnitrader.com/currentclients/otforum/thread-view.asp?threadid=6199.

I don't know what the current status is.


Hi Barry,
In that thread, you indicated you had recreated the problem, and reported it. Any status?

Steve

^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 9:53 AM
Post #28772 - In reply to #28754

Yes Steve, it appears to be same issue you reported a year back but it seems that Nirvana does not considered it to be critical enough to be fixed on a priority basis.
^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 11:01 AM
Post #28773 - In reply to #28772

I get it now - thanks for your patience in explaining.

Succinctly, the issue is that BT/FT/DO settings are affecting HRE Trade Calc sizing, and logically they should not.

Correct?
^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 9/6/2013 11:24 AM
Post #28774 - In reply to #28754

Yes, different BT, FT settings in the ToDoList coupled with BT,FT or Both settings in the Test Period in the Portfolio Simulation Settings produces different results in Trade Calculator.

Among the 3 methods I mentioned earlier, Fixed Risk is most sensitive and Fixed $ Amount is the least sensitive to these changes.


^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 2/3/2014 8:15 AM
Post #30802 - In reply to #28754

Trade Calculator appears to be completely broken in OT2014. In OT2013 there was at least a workaround (though very awkward) in the form of Forward Test in the "Test Period" Tab of PortSim to get the correct quantities in the Trade Calculator as detailed in my first post. Unfortunately this workaround is also not working in OT2014.

^ Top
Barry Cohen

Sage
500010010025
Posts: 5246

Joined: 1/19/2004

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 2/3/2014 5:40 PM
Post #30817 - In reply to #28754

I've attempted to reproduce this issue with your settings, but the calculator does not show zeroes for me. There is a bug that I reproduced before when running a forward test period with Monthly boundaries, along with Portfolio Simulation set to back test period only mentioned earlier in this thread, it is still an open issue.

I used a new profile with the Dow30, default strategies & the settings you provided.

FYI, you can leave DO off as it only gets activated when you're using an optimized strategy coupled with a forward test period.

^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 2/4/2014 7:09 AM
Post #30819 - In reply to #28754

The Trade Calculator doesn't always shows zeros, but it shows different quantities with different backtest/forward test settings which are wrong.

One thing I also noticed is that these wrong quantities are always much less and never more than the correct quantities.


^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 2/4/2014 7:18 AM
Post #30820 - In reply to #30819

I've been reviewing the thread. One comment I failed to make early on - when running DO, the BT and Both PortSim eval settings should not be used, ever. So, if they give zeroes or clearly flakey values, in a way that is sort of good, in that the user is not lulled into thinking the results are viable. Of course a popup error message re the setting selections being invalid would be preferable ;-)



[Edited by Jim Dean on 2/4/2014 7:19 AM]

^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 2/4/2014 7:29 AM
Post #30821 - In reply to #30820

Furthermore - no place did I see you post anything to say that the problem exists if DO is turned OFF. If the problem goes away when DO is turned off, then:
1. That helps Barry and the devel's a lot to diagnose the problem
2. It means that TC is not "completely broken" at all
3. The prob could be related to DO being on but nothing active in the Strat for it to work on

DO is a powerful tool but is is very complex to implement and very exhausting for the CPU. So, unless it's being used, it's just prudent to leave it turned off.

It might help for you to post once again, recapping whatever problems you are seeing and settings you are using, with DO turned OFF, and with statistically relevant numbers of periods in BT and FT zones. If you use very small numbers like 50, there may be zero trades for a given stock - that can produce misleading results.

It's alarming to see phrases like "completely broken". Qualifiers help.
^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 2/4/2014 7:32 AM
Post #30822 - In reply to #30821

However - afaik no PS or analysis-testing inputs should affect the workings of Chevron-based TC at the HRE. So, if that is happening, clarification of which settings "trigger" the faulty HRE calc's would be very helpful.
^ Top
Vinay

Legend
1001001001002525
Posts: 460

Joined: 12/9/2011
Location: Planet Earth

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 2/4/2014 8:36 AM
Post #30823 - In reply to #28754

Jim... as I mentioned earlier, although "DO" is enabled in the "Test Settings", but it is NOT being used anywhere in the present case. There is no optimization turned on anywhere in my strategy. There are no red lines around any of the blocks. Moreover I have turned off optimization in the Portfolio Simulation also.

I am not getting correct Trade Quantities even when "DO" is turned off.

The Trade Calculator, for example simply needs to take the % rate (in case of % of Equity Method) and apply that to the Equity as shown by the Portfolio Manager to arrive at the quantity. I can't see where the backtest/forwardtest and "DO" comes into picture here?

You mentioned earlier that "no PS or analysis-testing inputs should affect the workings of Chevron-based TC at the HRE", and the problem which I have been facing is happening exactly there only.



[Edited by Vinay on 2/4/2014 8:38 AM]

^ Top
Jim Dean

Idol
2000500100100
Posts: 2719
Online

Joined: 9/21/2006
Location: L'ville, GA

User Profile
 
Subject : RE: Trade Calculator Bug
Posted : 2/4/2014 8:48 AM
Post #30824 - In reply to #30823

Thanks. Yes you are correct re what should affect it.

My recent postings were to try to get clarification about what the "minimal" triggering circumstances are that create the result, in an attempt to provide more focused info to help speed along a fix ... the more narrow the focus, the faster the debugging (generally speaking).

Also, trying to get a handle on how "thoroughly broken" the TC is ... that is, under what circumstances is it working OK for you?

If my posts are not helping, I'll be quiet.
Jump to page : 1
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.