Supertrend per heiken ashi

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

    Buongiorno,

    utilizzo frequentemente l’indicatore Supertrend su grafici a candele giapponesi.  Volevo sapere se posso usare lo stesso indicatore supertrend così codificato anche su grafici Heiken Ashi oppure se serve una versione specifica che tenga conto delle specifiche delle open close ecc. che per heiken Ashi sono diversi dalle candele giapponesi.

    Grazie

    #165551 quote
    robertogozzi
    Moderator
    Master

    Si, serve una versione modifica appositamente per le candele HA, eccola:

    Multiplier = 3
    Periods    = 10
    / candele HA
    ONCE xOpen = open
    xClose     = (open + high + low + close) / 4
    IF BarIndex > 1 THEN
       xOpen   = (xOpen[1] + xClose[1]) / 2
    ENDIF
    xLow       = min(low,min(xClose,xOpen))
    xHigh      = max(high,max(xClose,xOpen))
    MedianHA   = (xHigh + xLow) / 2
    //
    IF BarIndex > Max(Periods,Multiplier) THEN
       MyATR         = AverageTrueRange[Periods](xClose) * Multiplier
       BasicUPPER    = MedianHA + MyATR
       BasicLOWER    = MedianHA - MyATR
       IF (BasicUPPER < FinalUPPER[1]) OR (xClose[1] > FinalUPPER[1]) THEN
          FinalUPPER = BasicUPPER
       ENDIF
       IF (BasicLOWER > FinalLOWER[1]) OR (xClose[1] < FinalLOWER[1]) THEN
          FinalLOWER = BasicLOWER
       ENDIF
       IF (ST[1] = FinalUPPER[1]) AND (xClose <= FinalUPPER) THEN
          ST = FinalUPPER
       ELSE
          IF (ST[1] = FinalUPPER[1]) AND (xClose > FinalUPPER) THEN
             ST = FinalLOWER
          ELSE
             IF (ST[1] = FinalLOWER[1]) AND (xClose >= FinalLOWER) THEN
                ST = FinalLOWER
             ELSE
                IF (ST[1] = FinalLOWER[1]) AND (xClose < FinalLOWER) THEN
                   ST = FinalUPPER
                ENDIF
             ENDIF
          ENDIF
       ENDIF
    ENDIF
    RETURN ST AS "Super Trend HA"
    Nicolas thanked this post
    SuperTrend-HA.itf
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Supertrend per heiken ashi


ProScreener: Scansione Mercati & Screener

New Reply
Author
author-avatar
pignolaus @pignolaus Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
4 years, 11 months ago.

Topic Details
Forum: ProScreener: Scansione Mercati & Screener
Language: Italian
Started: 03/28/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...