Aiuto per strategia con Supertrend

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

    buongiorno, non ho pratica nello scrivere le strategie, ma se qualcuno fosse gentile da aiutarmi vorrei realizzare la seguente:

    Acquisto: il Supertrend da orizzontale che era nelle candele precendenti diventa con pendenza positiva (ossia maggiore di quella precedente).

    Chiusura operazione: il Supertrend diventa con pendenza negativa (ossia minore della precedente).

    Grazie infinite, questa ovviamente è solo il motore della strategia, a cui poi cercherò di aggiungere condizioni supplementeari.

    Lorenzo

    #243216 quote
    Iván González
    Moderator
    Master

    Ecco cosa hai:

    DEFPARAM CumulateOrders=false
    ST = SuperTrend[3,10]
    flat=ST=ST[1]
    up=ST>ST[1]
    dn=ST<ST[1]
    
    IF not onmarket and up and flat[1] THEN
    BUY 1 contract AT MARKET
    ENDIF
    
    IF onmarket and dn THEN
    SELL AT MARKET
    ENDIF
    
    graphonprice ST coloured("blue")
    robertogozzi thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Aiuto per strategia con Supertrend


Supporto Piattaforma: Grafici, Dati e Broker

New Reply
Author
author-avatar
discomusic @discomusic Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Iván González
1 year, 1 month ago.

Topic Details
Forum: Supporto Piattaforma: Grafici, Dati e Broker
Language: Italian
Started: 01/29/2025
Status: Active
Attachments: No files
Logo Logo
Loading...