logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
uasish  
#1 Posted : Saturday, September 16, 2006 8:00:56 PM(UTC)
uasish

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/13/2005(UTC)
Posts: 170

Thanks: 7 times

Seniors,

Which function "Sum" or "Cum" or both is giving the mismatch in "exploration value & indicator value" of the following code.Is there a way to avoid this.

.........................................................................

a:= C ;
b:= 10000* ((63 * Sum(Cum(1) * C,63) - Sum(Cum(1),63) * Sum(C,63)) / (63 * Sum(Pwr(Cum(1),2),63) - Pwr(Sum(Cum(1),63),2)))/ a;
b;

.........................................................................

Asish

wabbit  
#2 Posted : Saturday, September 16, 2006 9:29:24 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
ashish,

Is this another "Load Minimum Bars" problem, or is the mismatch due to precision errors in the code?

You are multiplying very small numbers by large numbers to get a 'meaningful' result...

... also, with some minor high frequency errors, your code above is more simply written:

Code:

n:=63;
10000*LinRegSlope(C,n)/C;


You might have some better luck using the builtin function than hand coding?



wabbit [:D]
uasish  
#3 Posted : Sunday, September 17, 2006 6:32:30 AM(UTC)
uasish

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/13/2005(UTC)
Posts: 170

Thanks: 7 times

Wabbit,

I have copy pasted the same "Ln Reg " from another thread of this forum ,but thought by hard coding may be this mismatch problem can be avoided.Some how my earlier problem of mismatch with "Trough/Peak" is now resolved after weeks of hard work and bypassing "Zig" and following lots of "Jose's code",however this "Ln Reg" is not worth that much than Trough/Peak.Thanks for your reply.

Asish

wabbit  
#4 Posted : Sunday, September 17, 2006 5:57:26 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Asish,

We have mentioned this before : when you get a difference between the chart value and the exploration value can you please post the codes you used in both the exploration and the indicator, provide details of how many bars of data are loaded into the chart and the exploration and the return values of the charted indicator and the exploration so we can see what might be causing the problem.

In this situation, I will guess and say the difference between any exploration and the chart, using the same number of records, will be less than, say, 0.01. If you remove the scalar multiplier this error is in fact 0.0000001. If your trading system is sensitive to indicator values like this, I suggest you look again at your system.

I think you will find that if you load EXACTLY the same number of records into the exploration as the open chart then the 'mismatch' will no longer occur, or the difference will be negligible.



wabbit [:D]


wabbit  
#5 Posted : Sunday, September 17, 2006 6:23:03 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
... for example, if I plot:

Code:

a:= C ;
b:= ((63 * Sum(Cum(1) * C,63) - Sum(Cum(1),63) * Sum(C,63)) / (63 * Sum(Pwr(Cum(1),2),63) - Pwr(Sum(Cum(1),63),2)))/C;

n:=63;

x:=LinRegSlope(C,n)/C;

{plot}
abs(x-b);


on my chart of FGL, the maximum difference between the two indicators (b and x) is 0.000007777. If I reintroduce the scalar multiplier (10000) this difference is 0.07777. Numerically, the difference is larger in the second instance, but it is still insignificant!



wabbit [:D]


uasish  
#6 Posted : Monday, September 18, 2006 8:18:36 AM(UTC)
uasish

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/13/2005(UTC)
Posts: 170

Thanks: 7 times

Wabbit,

Last time after your advise i have a permanent 5000 bars load, both for my Indicator & Exlporation.As i use only EOD data for my trading signals & levels for Intraday/Swing trading i dont have to use the "Load Min" option (for MS to be faster),because i use the Broker Trading Terminal charts/signals for initiating my trades not MS .The code posted earlier gives values upto 1 decimal point correct on the "Exploration Combo Box",now when i open the "Inspect" of individual Securities value goes haywire .Plz advise me how to attach my charts here so that you can study.

Asish

wabbit  
#7 Posted : Monday, September 18, 2006 8:37:55 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
uasish wrote:
Last time after your advise i have a permanent 5000 bars load, both for my Indicator & Exlporation.


OK. This is probably not the cause of the error then.

uasish wrote:
The code posted earlier gives values upto 1 decimal point correct on the "Exploration Combo Box",now when i open the "Inspect" of individual Securities value goes haywire.


If you use the code as you posted, then a precision of 0.1 is really a precision of 0.00001 because you multiply the result by a large scalar value to achieve the 0.1 result. The LinRegSlope() is going to have 'difficulties' with its precision in stocks with low volatility and low price. There is nothing you can do about this. Values of smaller order than 10E-5 (0.000001) will contain precision errors. Only a complete re-write of MS will correct this.

Also, the more data in the chart, the larger the errors COULD be due to the nature of the Cum() function (potentially large numbers) and then Pow(Cum(1),2) (VERY large numbers). Small amounts of data are more useful/precise with any indicator that involves mathematical operations on any Cum() function. The same precision errors become evident in orders above 10E5.

uasish wrote:
Plz advise me how to attach my charts here so that you can study.


Upload a picture file (.png or .jpg or .gif) to your server, or use a free picture server (there are many) and add a link using the IMG tage in bbCode in yuor post.



wabbit [:D]


uasish  
#8 Posted : Monday, September 18, 2006 9:57:40 AM(UTC)
uasish

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/13/2005(UTC)
Posts: 170

Thanks: 7 times

Wabbit,

You missed my point because i may have not elaborated properly,in the "inspect" of individual securities of Exploration box, the value differs from the indicator value of the chart ,in some casees to the tune of .5%.

Asish

wabbit  
#9 Posted : Monday, September 18, 2006 6:27:24 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.