ProScreening by Moving Average Deviation Rate

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #127709 quote
    BITE1437
    Participant
    Average

    By the help of forum members, the following indicator, moving average deviation rate has been used for proscreening in long and short during the moving average line cross the two standard deviation lines. However, the results are not equal to the chart I find.

    //Moving average deviation rate
    
    //input
    
    maPeriod = 21
    
    //deviation rate
    
    sma = average[maPeriod](close)
    
    rate = close / sma * 100 - 100
    
    //deviation rate std
    
    stdCenter = average[maPeriod * 2](rate)
    
    istd = std[maPeriod * 2](rate)
    
    plusDev = stdCenter + istd * 2
    
    minusDev = stdCenter - istd * 2
    
    return rate coloured(255,0,0), stdcenter coloured(0,255,0), plusdev coloured(0,255,0), minusdev coloured(0,255,0)

     

    May I seek your advice on setup the proscreening code?

    #127727 quote
    Nicolas
    Keymaster
    Master

    The below code for the screener is working correctly, I embed the whole indicator code into the stock screener:

    //Moving average deviation rate
    
    //input
    
    maPeriod = 21
    
    //deviation rate
    
    sma = average[maPeriod](close)
    
    rate = close / sma * 100 - 100
    
    //deviation rate std
    
    stdCenter = average[maPeriod * 2](rate)
    
    istd = std[maPeriod * 2](rate)
    
    plusDev = stdCenter + istd * 2
    
    minusDev = stdCenter - istd * 2
    
    test = rate crosses over plusdev or rate crosses under minusdev
    
    screener[test]
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

ProScreening by Moving Average Deviation Rate


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
BITE1437 @bite1437 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
5 years, 10 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 04/24/2020
Status: Active
Attachments: No files
Logo Logo
Loading...