Discussions
»
Special Interest Groups
»
Basic Coding Techniques
»
Exploration for buy/sell signals based on Parabolic Sar
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 12/7/2010(UTC) Posts: 6
|
Friends, kindly help in coding an exploration that would throw up securities which have given a buy/sell signal based on Parabolic Sar. I tried using the customs indicator....does not work
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/7/2005(UTC) Posts: 602
|
You could try to filter something like:
a1:=SAR(0.02,0.2); a2:=Cross(C,a1); a2
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 12/7/2010(UTC) Posts: 6
|
Thank you very much indeed!!
But its not working. Here is what I tried...
1) I added the formula as "My Sar" to Indicator Builder and plotted it in a separate box over over securities.
Result: It works and shows spikes. But then how does it make a difference - I could directly plot SAR(already provided in indicators) on securites and observe visually.
2) I used the formula provided by you in one of the Explorer columns and ran it on 3500 securities
Result: In the result, it throws up N/A in that column against all the securities explored.
3) I removed the formula from the column and put it in the filter column and tried exploartion on 3500 securites.
Result: All the securities were rejected. I checked the "rejects" and against each securites the rejection reason was "Results of filter formula not defined on calculation date"
Request your help again!!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi Zombie
The reason for your exploration failure is most likely because you're running the Explorer with "Minimum Records" rather than setting a number of 50 or more. From memory the SAR() requires 16 or 17 bars of data before it will deliver a real result, otherwise you'll just get N/A. I don't think that number of bars needed varies with the parameter settings but, as I say, loading 50 bars or more will get rid of the reason for most N/A results.
Roy
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 12/7/2010(UTC) Posts: 6
|
Hello Roy, thanks a lot for the suggestion. I load a minimum of 1000 bars.
Kindly, try the formula/exploration yourself and let me know if it works.
Thanks once again!!
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi Zombie
I tested John's code in colummn A on the US S&P 500 for the 7th of December and got the following results.
N/A on all securities when loading 16 bars or less.
15 hits when loading 17 bars.
30 hits when moving up from 95 up to 100 bars loaded.
30 hits on all passes with more than 100 bars (I went as high as 5000 bars)
I ran the test again with John's code in the filter and got exactly the same results. These results confirm that with "Load Minimum Records" only N/A results can be expected.
Some but probably not all events will be detected with 17 or more bars loaded. It would be wise to load 250 or more bars to be sure of getting all hits - more bars loaded improves the accuracy of this particular test.
Apart from underestimating the number of bars required to pick up all Cross events I think my original comments pretty much covered the most likely cause of your problem. The only other thing that I can think of is that you modified John's code in some way so that it no longer perfermed the function you required of it.
Identical code in both the Indicator Builder and the Explorer will produce identical results if the same number of bars are loaded. The only thing different is the way the results are presented. Make sure that the Explorer is set to the same periodicity as the charts you're using for making any comparison.
Roy
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users, Subscribers Joined: 12/7/2010(UTC) Posts: 6
|
Roy.....you are absolutely right!!
It was my mistake.
When you mentioned the term - "load minimum records", I mistook it for the similar option provided for charting and never checked the one provided in Explorer.
I have rectified it now and its working fine. Two things I owe you and John......
1) sincere apologies for the mess-up &
2) a BIG THANKS
I am sure everybody would know now that I have nick-named myself correctly!!!!!
Cheers!!!
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Discussions
»
Special Interest Groups
»
Basic Coding Techniques
»
Exploration for buy/sell signals based on Parabolic Sar
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.