Domanda trading automatico

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #3872 quote
    Giorgio78Giorgio78
    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
    NicolasNicolas
    Keymaster
    Legend

    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
    Giorgio78Giorgio78
    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.
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

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 Giorgio78Giorgio78
10 years, 6 months ago.

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