Domanda trading automatico

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3872 quote
    Giorgio78
    Participant
    New

    Salve,

    vorrei creare un sistema di trading automatico che compra quando la media mobile ha una tendenza positiva (al rialzo) e che vende quando ha una tendenza negativa (al ribasso) .

    Per esempio:

    Acquisto: vorrei che il sistema entri con una posizione LONG quando la media mobile di  X giorni (ieri)  è  maggiore della media mobile di X giorni (2 giorni fà).

    Vendita: Vorrei vendere nel caso in cui si verifichi la situazione inversa.

    Grazie!!!

    #3896 quote
    Nicolas
    Keymaster
    Master

    Ciao Giorgio, attaccato un piccolo sistema di trading automatico basato sul media mobile crossover. Sperando di aver risposto alla tua attesa! Un bienôt e vi prego 🙂

    DEFPARAM CumulateOrders=false
    
    i1=average[10](Close)
    i2=average[30](Close)
    
    IF i1 CROSSES UNDER i2 THEN
    
      SELLSHORT 1 share AT MARKET
      SELL AT MARKET
    
    ENDIF
    
    
    IF i1 CROSSES OVER i2 THEN
    
      BUY 1 share AT MARKET
      EXITSHORT AT MARKET
    
    ENDIF
    
    SET STOP LOSS 20
    #3974 quote
    Giorgio78
    Participant
    New

    Grazie Nicolas, adesso funziona! 🙂

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

Domanda trading automatico


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Giorgio78 @giorgio Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Giorgio78
9 years, 10 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 03/17/2016
Status: Active
Attachments: No files
Logo Logo
Loading...