[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Re: Rules Management for Trading System



PureBytes Links

Trading Reference Links

Hi Eric,

At the moment, we are adjusting the weights linearly, by adding or
subtracting an amount each time they work or don't work.  So we could
go negative.  If we adjust them by adding a percentage, then this
should not be a problem.  Initially we looked at both methods and I
think I mentioned that the weights may go negative, so we start with
big ones initially.  Try the following

W1 := PREV*(1+PC*P1);
W2 := PREV*(1+PC*P2);
W3 := PREV*(1+PC*P2);

Also, maybe add this input, together with the other, at the top:

PC:=Input("Penalise % : ",0,100,10)/100;
SM:=Input("Smooth % : ",0,100,75)/100;

and change the weights to

W1 := SM*PREV + (1-SM)*PREV*(1+PC*P1);
W2 := SM*PREV + (1-SM)*PREV*(1+PC*P2);
W3 := SM*PREV + (1-SM)*PREV*(1+PC*P2);

Then enter a highish value (even 99 or 99.9 is fine) for SM.  The
higher this value, the more smooth the weights will be.

As long as the weights increase, it means they are working!  So it is
good if they keep on increasing.  You can 'reset' them after each
round, since we only use the relative ones.  I am not sure how to do
this in one variable in MSFL, but it is easy to do by introducing yet
another bunch of variables.

Right at the end, change to the following

WA:=W1+W2+W3;
{Standard weights}
SW1:=W1/WA;
SW2:=W2/WA;
SW3:=W3/WA;
TA:=SW1*T1+SW2*T2+SW3*T3;
TA;

Now, SW1 ... SW3 will always be between 0 and 1 and will be the
percentage of the total signal that comes from the relevant indicator.
 Thus it does not matter how big W1 becomes, SW1 will be between 0 and
1.  To make it easier on the plotting, you could change the above to

WA:=W1+W2+W3;
{Standard weights}
SW1:=W1/WA*100;
SW2:=W2/WA*100;
SW3:=W3/WA*100;
TA:=(SW1*T1+SW2*T2+SW3*T3)/100;
TA;

to get SW1 ... SW3 to be between 0 and 100.

Finally, even though SW1 is contained, W1 is not and may run away. 
Again, using something else you would at the end of each loop assign
SW1 to W1 but I'm not sure this will work in MSFL.  If you get numbers
that run away, you will pick it up in WA, and we can fix it if it happens.

Regards
MG Ferreira
TsaTsa EOD Programmer and trading model builder
http://www.ferra4models.com
http://fun.ferra4models.com 






--- In equismetastock@xxxxxxxxxxxxxxx, chichungchoi <no_reply@xxxx> wrote:
> Hi MG Ferreira:
> Do you receive my email for the results?
> I found the error of the negative value for the weighting factor, As 
> I observe each value under the following
> formula
> 
> PC = 0.1
> DR:=(C/Ref(C,-1)-1)*C;
> P3:=DR*((T3>0)-(T3<0));
> W3:=If(P3=0,PREV,W3+(P3*(1+PC)));
> 
> [29 Oct 1997]
> W3 = 1669.51
> 
> [30 Oct 1997]
> C = 9059.9; REF(C,-1) = 10498.2
> DR = -1241.25 [OK]
> T3 = -1 [OK]
> P3 = 1241.25 [OK]
> W3 = 2365.37 [ERROR]
> 
> [31 Oct 1997]
> C = 10765.3; REF(C,-1) = 9059.9
> DR = 2026.42 [OK]
> T3 = -0.54499 [OK]
> P3 = -2026.42 [OK]
> W3 = -1229.06 [ERROR]
> 
> ----------------------------------------------------------------------
> 
> On the other hands, if changing W3 to PREV, then
> PC = 0.1
> DR:=(C/Ref(C,-1)-1)*C;
> P3:=DR*((T3>0)-(T3<0));
> W3:=If(P3=0,PREV,PREV+(P3*(1+PC)));
> 
> [29 Oct 1997]
> W3 = 28072.17
> 
> [30 Oct 1997]
> C = 9059.9; REF(C,-1) = 10498.2
> DR = -1241.25 [OK]
> T3 = -1 [OK]
> P3 = 1241.25 [OK]
> W3 = 29437.54 [OK]
> 
> [31 Oct 1997]
> C = 10765.3; REF(C,-1) = 9059.9
> DR = 2026.42 [OK]
> T3 = -0.54499 [OK]
> P3 = -2026.42 [OK]
> W3 = 27208.48 [OK]
> 
> The result looks completely different, and it seems to me, the
> weighting factors are growing bigger and bigger. Do you have any idea 
> on how to handle the weight in a huge amount? since the pently 
> function will be less effective to affect the weight as it grows 
> bigger and bigger. How do I know what the maximum level of weighting 
> factors will be effective in assigning value for learning? such as
> I don't think the pently function [-2026] will be effective, if the 
> level of weight is 1,000,000,000.
> Do you have any suggestion?
> Thank you
> Eric :>




------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/