Weekly & Daily Stochastics

The AIQ code based on Vitali Apirine’s article in the September issue of Stocks and Commodities, “Weekly and Daily Stochastics, is provided below

Using Apirine’s weekly and daily stochastic indicators and a moving average to determine trend direction, I created an example system (long only) with the following rules:

Enter long next bar at open when all of the following are true:

  1. The 200-day simple average of the NDX is greater than the day before
  2. The 200-day simple average of the stock is greater than the day before
  3. Both the weekly and daily stochastic indicators have been below 20 in the last five days
  4. Both the weekly and daily stochastic indicators are greater than the day before.

I tested three exits. Figure 8 shows a 21-day hold then exit. Figure 9 shows a three-moving-average trend-following exit. Figure 10 shows an exit using only the weekly & daily stochastic, once both are lower than the day before.

Sample Chart

FIGURE 8: AIQ, BUY and HOLD. Here is the sample equity curve (blue) compared to the NDX (red) for the test using a 21-day hold exit.

Sample Chart

FIGURE 9: AIQ, TREND-FOLLOWING EXIT. Here is the sample equity curve (blue) compared to the NDX index (red) for the test using a trend-following exit.

Sample Chart

FIGURE 10: AIQ, W and D STOCHASTIC EXIT. Here is the sample equity curve (blue) compared to the NDX index (red) for the test using the weekly and daily stochastic indicators.

The 21-day hold test showed a 11.2% return with a maximum drawdown of 29.3%. The trend-following exit test showed a 17.6% return with a maximum drawdown of 28.8%. The test using an exit based on only the weekly and daily stochastic indicators showed a return of 2.9% with a maximum drawdown of 32.5%. All the tests used the same entry rule and were run on an old 2016 list of the NASDAQ 100 stocks with the stocks that are no longer trading deleted.

!Author: Vitali Apirine, TASC Sept 2018
!Coded by: Richard Denning 7/7/2018

Periods is 14.
Periods1 is 3.
Pds is 70. 
Pds1 is 3.
smaLen1 is 70.
exitType is 1.

C is [close].
H is [high].
L is [low].

STOCD is (C-LOWRESULT(L,Periods))/(HIGHRESULT(H,Periods)-LOWRESULT(L,Periods))*100. 
SD is Simpleavg(Stocd,Periods1).
SW is Simpleavg(Stocw,Pds1).
HD if hasdatafor(1000) >= 500.
SMA200 is simpleavg(C,200).
SMA200ndx is tickerUDF("NDX",SMA200).

Buy if SMA200ndx > valresult(SMA200ndx,1)
          and SMA200 > valresult(SMA200,1)
          and SW > valresult(SW,1) 
          and SD > valresult(SD,1) 
          and countof(SW < 20,5)>=1 
          and countof(SD < 20,5)>=1 
          and HD.
smaLen2 is smaLen1*2.
smaLen3 is smaLen1*4.
SMA1 is simpleavg(C,smaLen1).
SMA2 is simpleavg(C,smaLen2).
SMA3 is simpleavg(C,smaLen3).
PD is {position days}.

Sell if (SD < valresult(SD,1) and SW < valresult(SW,1) and exitType=1)
       or (exitType = 2 
           and ((Valresult(C,PD)valresult(SMA1,PD) And Cvalresult(SMA2,PD) And Cvalresult(SMA3,PD) And C 250)).

RSS is C/valresult(C,120).
RSL is C/valresult(C,240).

—Richard Denning


for AIQ Systems

22 thoughts on “Weekly & Daily Stochastics

  1. I wish to express appreciation to you for bailing me out of this type of circumstance. Right after looking out throughout the the web and meeting ideas that were not beneficial, I thought my entire life was well over. Living devoid of the answers to the issues you have fixed by means of your entire guide is a crucial case, and ones that might have negatively damaged my career if I had not come across your site. Your own personal knowledge and kindness in taking care of every part was very useful. I don’t know what I would’ve done if I hadn’t come upon such a step like this. I can at this time relish my future. Thank you so much for the high quality and amazing help. I will not hesitate to refer your site to anybody who should have recommendations on this issue.

  2. I want to point out my admiration for your kindness for those people that have the need for help with this important niche. Your very own commitment to passing the solution across appeared to be remarkably important and have continually enabled those just like me to reach their aims. Your important report indicates so much a person like me and still more to my fellow workers. Thank you; from each one of us.

  3. I needed to post you the little note to finally give many thanks over again considering the marvelous pointers you have discussed on this site. This has been simply incredibly open-handed with people like you giving freely all a number of us might have made available as an e book to make some money for themselves, chiefly since you might well have done it if you considered necessary. Those secrets additionally worked to become a great way to comprehend other people online have the identical desire really like my very own to learn way more related to this issue. I know there are a lot more enjoyable times ahead for folks who examine your blog.

  4. I definitely wanted to write a simple comment to express gratitude to you for those wonderful recommendations you are showing on this site. My extensive internet investigation has finally been recognized with incredibly good facts and techniques to exchange with my co-workers. I ‘d point out that we website visitors are undoubtedly blessed to be in a useful community with so many awesome individuals with very helpful strategies. I feel rather happy to have seen the web pages and look forward to plenty of more excellent minutes reading here. Thanks once again for a lot of things.

  5. I’m also writing to make you understand what a impressive discovery my daughter enjoyed checking your site. She learned several pieces, which include how it is like to possess an amazing coaching character to have many more just know precisely specified complicated topics. You really exceeded visitors’ desires. Thanks for giving the interesting, trustworthy, edifying not to mention fun tips about that topic to Evelyn.

  6. I as well as my guys were found to be digesting the best key points located on your site then unexpectedly I had an awful suspicion I had not thanked the website owner for those tips. The young boys happened to be absolutely warmed to read through them and have in effect quite simply been having fun with them. Many thanks for actually being really helpful as well as for utilizing some remarkable useful guides millions of individuals are really wanting to discover. My honest apologies for not saying thanks to you earlier.

  7. Link exchange is nothing else except it is just placing the other person’s weblog link on your page at suitable place
    and other person will also do similar in favor of you.

  8. What i don’t understood is in reality how you are now not really a lot more neatly-favored than you may be now.
    You’re very intelligent. You realize thus significantly with regards
    to this subject, produced me in my opinion imagine it from so
    many varied angles. Its like women and men don’t seem to be fascinated unless it’s something to accomplish with Girl gaga!
    Your own stuffs great. At all times handle it up!

  9. I precisely needed to appreciate you yet again. I do not know the things I would have accomplished in the absence of the concepts provided by you directly on such a subject. It was before a troublesome dilemma in my view, nevertheless viewing this expert style you resolved the issue forced me to leap for gladness. Now i’m happy for your work as well as trust you really know what an amazing job you’re putting in teaching many others by way of your web page. I know that you haven’t met any of us.

  10. hi!,I love your writing very so much! percentage
    we keep in touch extra about your article on AOL?
    I need a specialist on this area to unravel my problem. Maybe that is you!

    Having a look forward to peer you.

  11. Wonderful site. A lot of helpful info here. I’m sending it to some buddies ans additionally sharing in delicious.
    And certainly, thanks to your sweat!

  12. I have to show my admiration for your generosity for those who should have assistance with the idea. Your special dedication to getting the message all-around appeared to be definitely advantageous and have usually empowered some individuals much like me to get to their objectives. Your entire warm and helpful guideline implies so much to me and still more to my mates. With thanks; from everyone of us.

  13. Great weblog here! Additionally your web site quite a
    bit up very fast! What host are you the use of?

    Can I am getting your associate hyperlink in your host?
    I desire my website loaded up as quickly as yours lol

  14. I must show my thanks to the writer just for bailing me out of this type of predicament. After checking through the the net and coming across notions which are not helpful, I figured my life was gone. Existing without the presence of strategies to the issues you’ve fixed as a result of your good article content is a serious case, and ones that would have in a negative way affected my career if I had not encountered your web page. Your own natural talent and kindness in dealing with all things was priceless. I am not sure what I would’ve done if I had not discovered such a solution like this. I’m able to at this moment look forward to my future. Thanks so much for this professional and results-oriented guide. I will not be reluctant to propose your blog to anybody who desires guide on this subject.

  15. Clomid Glucophage Effets Secondaires Best Price Online Cialis 10mg Generic Dutasteride Low Price Without Rx [url=http://catabs.com]priligy y viagra son compatibles[/url] Kamagra Farmaco Buy Sildenafil Canada Orlistat Effets Secondaires

  16. I’m just commenting to let you be aware of of the useful experience my wife’s daughter experienced using your site. She came to find numerous details, which include what it’s like to possess a very effective coaching heart to get other people without problems learn about specified advanced issues. You truly surpassed her desires. I appreciate you for coming up with these informative, dependable, revealing and as well as easy tips on this topic to Janet.

Leave a Reply

Your email address will not be published.