Supetrend di segno contrario

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #154902 quote
    claudio ccclaudio cc
    Participant
    Junior

    buongionrmo e grazie in anticipo per l’aiuto che mi potrete dare. E’ possibile Scrivere un codice per avere un supetrend di segno contrario a quello normale per creare una sorta di canale ? Grazie mille

    #154932 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Eccolo, dalla proprietà puoi scegliere di fare 3 cose:

    • visualizzare il SuperTrend normale
    • visualizzare il SuperTrend inverso
    • visualizzare entrambi
    // Super Trend inverso (& channel)
    //
    //Multiplier     = 3
    //Periods        = 10
    Multiplier       = Max(1,Min(999,Multiplier))
    Periods          = Max(1,Min(999,Periods))
    IF BarIndex > Max(Periods,Multiplier) THEN
    MyATR         = AverageTrueRange[Periods](close) * Multiplier
    BasicUPPER    = MedianPrice + MyATR
    BasicLOWER    = MedianPrice - MyATR
    IF (BasicUPPER < FinalUPPER[1]) OR (close[1] > FinalUPPER[1]) THEN
    FinalUPPER = BasicUPPER
    ENDIF
    IF (BasicLOWER > FinalLOWER[1]) OR (close[1] < FinalLOWER[1]) THEN
    FinalLOWER = BasicLOWER
    ENDIF
    IF (ST[1] = FinalUPPER[1]) AND (close <= FinalUPPER) THEN
    ST = FinalUPPER
    SX = FinalLOWER
    ELSE
    IF (ST[1] = FinalUPPER[1]) AND (close > FinalUPPER) THEN
    ST = FinalLOWER
    SX = FinalUPPER
    ELSE
    IF (ST[1] = FinalLOWER[1]) AND (close >= FinalLOWER) THEN
    ST = FinalLOWER
    SX = FinalUPPER
    ELSE
    IF (ST[1] = FinalLOWER[1]) AND (close < FinalLOWER) THEN
    ST = FinalUPPER
    SX = FinalLOWER
    ENDIF
    ENDIF
    ENDIF
    ENDIF
    ENDIF
    RETURN ST AS "Super Trend",SX AS "Super Trend inverted"
    x-8.jpg x-8.jpg Super-Trend-inverso-channel.itf
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

Supetrend di segno contrario


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
claudio cc @claudio1964 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 12/22/2020
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...