Smoothed Heiken Ashi lags

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

    Hi there guys,

    i have a question, i want to use the smoothed heiken ashi indicator (in my version eliminating highs and lows of smoothed heiken ashi) but screening the stocks one by one it takes too much time. So i thought to use the ‘defparam calculateonlastbars’.

    I get an error. What is the right syntax of the command ‘defparam’ for lets say the last 5 bars?

    Will the screener work using the following code?

    Thanx!!!

    PS my aim is to find the turning point of smoothed heiken ashi

    DEFPARAM CalculateOnLastBars = 5 
        
    IF BarIndex=0 THEN
    xClose = (open+high+low+close)/4
    xOpen = open
    
    ELSE
    xClose = (open+high+low+close)/4
    xOpen = (xOpen[1]+xClose[1])/2
    
    endif
    
    //Smoothed Heikin-Ashi
    xxclose=Average[max (1,HeikinPeriod),AverageType](xclose)
    xxOpen = Average[max (1,HeikinPeriod),AverageType](xOpen)
    
    //bullish
    c1= xxopen[-1] > xxclose[-1]
    c2= xxopen < xxclose
    c3= c1 and c2
    
    //bearish
    c8= xxopen[-1] < xxclose[-1]
    c9= xxopen > xxclose
    c10= c8 and c9
    
    screener [c3 or c10]
    #225264 quote
    JSJS
    Participant
    Master

    Hi @gnellas77

    You can’t/shouldn’t define parameters in a screener… (DefParam is not allowed)

    In your code, you can’t use negative values for the index of a variable, so xxopen[-1] is not allowed, values must be whole and positive.

    I tried your screener but in this form, it is certainly not slow, after a few seconds results already appeared…

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Smoothed Heiken Ashi lags


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
gnellas77 @gnellas77 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JSJS
2 years, 9 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 12/14/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...