Traderji.com - Discussion forum for Stocks Commodities & Forex

Discussion on kolkata meet signal

Discuss Discussion on kolkata meet signal at the MetaStock within the Traderji.com - Discussion forum for Stocks Commodities & Forex; Originally Posted by kkseal Ok, first things first In Sanjay's code (AFL not MS code) ...


Go Back   Traderji.com - Discussion forum for Stocks Commodities & Forex > TOOLS & RESOURCES > Software > MetaStock

Notices


Advertise Here

Reply
 
Thread Tools
Sponsored Links
  #51  
Old 22nd April 2008, 06:58 PM
SGM SGM is offline
Member
 
Join Date: Aug 2005
Location: PUNE
Posts: 468
Blog Entries: 14
Thanks: 11
Thanked 41 Times in 12 Posts
SGM will become famous soon enough
Reputation: 81
Default Re: Discussion on kolkata meet signal

Quote:
Originally Posted by kkseal View Post
Ok, first things first

In Sanjay's code (AFL not MS code) insert

a = 22/(7*a);

after 1st line.

This'll solve a basic problem (& regenerate interest in the indi ).

Regards,
Kalyan.
hmm another of those greeks ... this time the Pi fello

so we use another conversion radians/degrees.. interesting

but shouldn't it be a = (22/7) * (a / 180)

anyway use what kalyan says, i have not tested this, he must have tested the code

Quote:
Originally Posted by kkseal View Post
Why bother when the results are so bad?
So it was worth bothering, hopefully the results will change now that we have a fix in place.

Quote:
Originally Posted by kkseal View Post
(Not many will be interested anyway)
Well at last we found something to agree on

rgrds
Sanjay
Reply With Quote
Sponsored Links
  #52  
Old 22nd April 2008, 07:24 PM
Member
 
Join Date: Nov 2006
Posts: 1,496
Thanks: 55
Thanked 67 Times in 36 Posts
kkseal will become famous soon enoughkkseal will become famous soon enough
Reputation: 131
Default Re: Discussion on kolkata meet signal

Right. Code Edited.

I was using Rad values straightaway.
(Currently grappling with ways to deal with EVEN periods )

Regards,
Kalyan.
Reply With Quote
  #53  
Old 22nd April 2008, 07:46 PM
SGM SGM is offline
Member
 
Join Date: Aug 2005
Location: PUNE
Posts: 468
Blog Entries: 14
Thanks: 11
Thanked 41 Times in 12 Posts
SGM will become famous soon enough
Reputation: 81
Default Re: Discussion on kolkata meet signal

No sweat, here we go

Code:
_SECTION_BEGIN("Asish_Indicator_01");
a  =  Param("Angle",30,15,45,1);
a  =  (22/7) * (a/180);  

Num = 0;
Den = 0;

n  = Param("Sin_Len",3,1,100,1);

for (i = 1;i < n+1;i++)
{
	Num = Num + sin(n*a) * Ref(C,-n-1) ;
	Den = Den + sin(n*a);
}

j1 = Num / Den;
Plot(IIf(j1 > Ref(j1,-1),-10,10),"j1",IIf(j1 > Ref(j1,-1),colorBlueGrey,colorLime), styleThick);

_SECTION_END();
Reply With Quote
  #54  
Old 22nd April 2008, 08:01 PM
Member
 
Join Date: Sep 2004
Posts: 1,532
Thanks: 622
Thanked 921 Times in 385 Posts
rkkarnani is a splendid one to beholdrkkarnani is a splendid one to beholdrkkarnani is a splendid one to beholdrkkarnani is a splendid one to beholdrkkarnani is a splendid one to beholdrkkarnani is a splendid one to beholdrkkarnani is a splendid one to beholdrkkarnani is a splendid one to behold
Reputation: 982
Default Re: Discussion on kolkata meet signal

Quote:
Originally Posted by kkseal View Post
Ok, first things first

In Sanjay's code (AFL not MS code) insert

a = (22/7)*(a/180);

after 1st line.

This'll solve a basic problem (& regenerate interest in the indi ).

Regards,
Kalyan.
Any "correction" required in MS code to make it give better results!!!!!
Reply With Quote
  #55  
Old 22nd April 2008, 08:08 PM
Member
 
Join Date: Nov 2006
Posts: 1,496
Thanks: 55
Thanked 67 Times in 36 Posts
kkseal will become famous soon enoughkkseal will become famous soon enough
Reputation: 131
Default Re: Discussion on kolkata meet signal

The weighting has to be consistent (triangular) for both even & odd lengths(periods) Here's what i suggest for a 6 period SWMA

Num = (sin(1*a) * P) + (sin(2*a) * Ref(P,-1)) + (sin(3*a) * Ref(P,-2)) + (sin(3*a) * Ref(P,-3)) + (sin(4*a) * Ref(P,-4)) + (sin(5*a) * Ref(P,-5));
Den = sin(a) + sin(2*a) + sin (3*a) +sin(3*a) + sin(4*a) + sin(5*a);

And for 4 period :-
Num = (sin(1*a) * P) + (sin(2*a) * Ref(P,-1)) + (sin(2*a) * Ref(P,-2)) + (sin(3*a) * Ref(P,-3)) ;
Den = sin(a) + sin(2*a) + sin (2*a) +sin(3*a);

For a = 30(degrees) the respective Sine weights would be

For 4 pd : sin30, sin60, sin60, sin30
For 6 pd : sin30, sin60, sin90, sin90, sin60, sin30

Whereas for 5 pd(ODD) it is
sin30, sin60, sin90, sin60, sin30

Correct if wrong.

Regards,
Kalyan.

Last edited by kkseal; 22nd April 2008 at 09:13 PM.
Reply With Quote
  #56  
Old 22nd April 2008, 08:33 PM
SGM SGM is offline
Member
 
Join Date: Aug 2005
Location: PUNE
Posts: 468
Blog Entries: 14
Thanks: 11
Thanked 41 Times in 12 Posts
SGM will become famous soon enough
Reputation: 81
Default Re: Discussion on kolkata meet signal

Quote:
Originally Posted by kkseal View Post
The weighting has to be consistent (triangular) for both even & odd lengths(periods) Here's what i suggest for a 6 period SWMA
Hello Kalyan

This is all over the head for me. I never understood the logic behind this indicator. Was just trying to convert it to afl. Its good that you took over the amibroker part of the project.

I think now you and asish should give the members some sort of conceptual inputs / background. (well only if some interest is expressed)

As for me, cycles stuff is way out of line of my current studies. Also I am not currently looking for developing new indicators etc.

Was fun coding/testing. I hope something usable comes out of this project.

Once you stabilize the indicator/signal code, It would interesting to try to build a system around it. If needed, can chip in with coding/testing.

Regards
Sanjay
Reply With Quote
  #57  
Old 22nd April 2008, 08:37 PM
SGM SGM is offline
Member
 
Join Date: Aug 2005
Location: PUNE
Posts: 468
Blog Entries: 14
Thanks: 11
Thanked 41 Times in 12 Posts
SGM will become famous soon enough
Reputation: 81
Default Re: Discussion on kolkata meet signal

Quote:
Originally Posted by rkkarnani View Post
Any "correction" required in MS code to make it give better results!!!!!
Hello RK

No change is needed in the MS code, the change in afl is required because of a bug / error in the afl code.

Now Kalyan has proposed some changes, that are yet to be coded in ami or MS

Regards
Sanjay
Reply With Quote
  #58  
Old 22nd April 2008, 08:38 PM
Member
 
Join Date: Nov 2006
Posts: 1,496
Thanks: 55
Thanked 67 Times in 36 Posts
kkseal will become famous soon enoughkkseal will become famous soon enough
Reputation: 131
Default Re: Discussion on kolkata meet signal

Sanjay, pls see if you can detect the error in this piece of code (possibly in the IF condition)

HTML Code:
pd=6;

Num = 0;
Den = 0;

for(i=1; i<=pd; i++)
{
	if(pd%2==0 AND i==(pd/2+1)) X = sin((i-1)*a);
	else X = sin(i*a);
	Num = Num + X*Ref(P,1-i);
	Den = Den + X;
}
i have taken fixed period=6 for testing. 'a' & the rest of the stuff is same as before.

Regards,
Kalyan.
Reply With Quote
  #59  
Old 22nd April 2008, 08:42 PM
SGM SGM is offline
Member
 
Join Date: Aug 2005
Location: PUNE
Posts: 468
Blog Entries: 14
Thanks: 11
Thanked 41 Times in 12 Posts
SGM will become famous soon enough
Reputation: 81
Default Re: Discussion on kolkata meet signal

Quote:
For a = 30(degrees) the respective Sine weights would be

For 4 pd : sin30, sin60, sin60, sin30
For 6 pd : sin30, sin60, sin90, sin90, sin60, sin30

Whereas for 5 pd(ODD) it is
sin30, sin60, sin90, sin60, sin30
Hello Kalyan

Coding this should be simple, use a counter to count up (till i = n/2) and then down inside the for loop, use the count instead of i for the angle

rgrds
Reply With Quote
  #60  
Old 22nd April 2008, 08:51 PM
Member
 
Join Date: Nov 2006
Posts: 1,496
Thanks: 55
Thanked 67 Times in 36 Posts
kkseal will become famous soon enoughkkseal will become famous soon enough
Reputation: 131
Default Re: Discussion on kolkata meet signal

Yeah got it. Only 'i' will not do for even pds.

Regards,
Kalyan.
Reply With Quote
Sponsored Links

Reply

Bookmarks


Advertise Here


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT +5.5. The time now is 03:40 PM.

Indemnity, Disclaimer & Disclosure Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum Rules Disclaimer & Disclosure and indemnify Traderji.com, its associates and related parties of all claims howsoever resulting from the usage of the forum.
Disclaimer: Trading or investing in stocks & commodities is a high risk activity. Any action you choose to take in the markets is totally your own responsibility. Traderji.com will not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein. The writers may or may not be trading in the securities mentioned.
• All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy of information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. If you find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.
 


Copyright © 2001 - 2008, Traderji.com All Rights Reserved.

Recommended Websites - www.TradersEdgeIndia.com - www.TradingPicks.com - www.MasterOfTrading.com