Trading automatico con Supertrend

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #118847 quote
    Panic_85
    Participant
    Junior

    Salve a tutti,

    chiedo aiuto e scusa perchè mi rendo conto che quanto sto per chiedere è una cosa banale, ma per me al momento è impensabile

    riuscire a scrivere un codice simile, anche se sto cercando di imparare.

    Vorrei realizzare un trading sistem con le seguenti caratteristiche:

    Stringa con supertrend personalizzabile, cioè dove semplicemente io possa andare a modificare i valori standard 3 -10 dal testo.

    Acquistare una certa quantità quando l’indicatore è positivo, quindi trovarmi long, mentre invece quando l’indicatore diventa negativo,

    vendere tutto e andare short con la stessa quantità.

    Al momento mi basta questo, poi vedrò se avrò la necessità di aggiungere qualche regola.

    Ringrazio in anticipo

    #118851 quote

     

    Ecco il sistema Supertrend, ti ho inserito anche un target e uno stop loss in percentuale.
    
    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    
    // Condizioni per entrare su posizioni long
    indicator1 = SuperTrend[3,10]
    c1 = (close[1] > indicator1[1])
    
    IF c1 THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Condizioni per entrare su posizioni short
    indicator2 = SuperTrend[3,10]
    c2 = (close[1] < indicator2[1])
    
    IF c2 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    
    // Stop e target
    SET STOP %LOSS 3
    SET TARGET %PROFIT 1
    robertogozzi thanked this post
    #118852 quote
    Panic_85
    Participant
    Junior

    Grazie mille per la pronta risposta.

    Gentilissimo

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

Trading automatico con Supertrend


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Panic_85 @panic_85 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Panic_85
6 years ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 02/06/2020
Status: Active
Attachments: No files
Logo Logo
Loading...