Fractal Screening

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #100626 quote
    SimbaSimba
    Participant
    Junior

    Hey Guys,

    I need some help for a screening idea.

    The screener has to show me all stocks (or other things) where the high fractal is 5 candles in the past.

     

    I used this indicator code

    // Visualisation des fractales avec flèches
    Arrow = 0
     
    // Nombres de bougies constituant la fractale (impair)
    Ncandles = 5
     
    // Nombres de bougies de chaque côté de la bougie extrême
    Nside = (Ncandles - 1) / 2
     
    // Définition de la fractale supérieure
    IF high[Nside] >= highest[Ncandles](high) THEN
    Fup = high[Nside]
    Arrow = -1
    ENDIF
     
    // Définition de la fractale inférieure
    IF low[Nside] <= lowest[Ncandles](low) THEN
    Fdown = low[Nside]
    Arrow = 1
    ENDIF
     
    // Tracé des flèches
    IF Arrow = 1 THEN
    DRAWARROWDOWN(barindex[2],low[2]-Averagetruerange[5]/3)coloured(255,0,0)
    ELSIF Arrow = -1 THEN
    DRAWARROWUP(barindex[2],high[2]+Averagetruerange[5]/3)coloured(0,150,0)
    
    ENDIF
     
    Return Fup as "Fractale UP", Fdown as "Fractale DOWN"

    Dropped the drawing code, so it looked at the end like this:

    // Visualisation des fractales avec flèches
    Arrow = 0
     
    // Nombres de bougies constituant la fractale (impair)
    Ncandles = 5
     
    // Nombres de bougies de chaque côté de la bougie extrême
    Nside = (Ncandles - 1) / 2
     
    // Définition de la fractale supérieure
    IF high[Nside] >= highest[Ncandles](high) THEN
    Arrow = -1
    ENDIF
     
    // Définition de la fractale inférieure
    IF low[Nside] <= lowest[Ncandles](low) THEN
    Arrow = 1
    ENDIF
    
    // Beispielcode Screener
    SCREENER[Arrow[5] = 1]

    So problem is: it does not work. Is anybody out there who can tell me what I am doing wrong? 🙂

    #100631 quote
    NicolasNicolas
    Keymaster
    Legend

    This is the code that should work in this case:

    // Nombres de bougies constituant la fractale (impair)
    Ncandles = 5
     
    // Nombres de bougies de chaque côté de la bougie extrême
    Nside = (Ncandles - 1) / 2
     
    // Définition de la fractale supérieure
    fractal = high[Nside] >= highest[Ncandles](high) 
     
    
    
    // Beispielcode Screener
    SCREENER[fractal[5]]

    Bear in mind that Fractals appear on candlesticks in the past, so even scanning a fractal occurrence 5 bars ago doesn’t mean that the fractal will be displayed 5 bars ago from the current bar.

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

Fractal Screening


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Simba @simba Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
7 years, 3 months ago.

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