dax intraday da 5' a 30' trendfollowing,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #78004 quote
    AlessioAlessio
    Participant
    Senior

    Buongiorno, sto provando questo ts sul dax per intraday, però funziona meglio su 2h. funziona entrando long su nuovi massimi dell’ultimo periodo (5-20) e short su nuovi minimi. vorrei rendere variabile il periodo. il trailing mi da sempre errore.

    grazie

    // Definizione dei parametri del codice
    DEFPARAM CumulateOrders = False // Posizioni cumulate disattivate
    
    // Impedisce al sistema di creare nuovi ordini per entrare a mercato o aumentare la taglia della posizione prima dell'orario specificato
    noEntryBeforeTime = 080000
    timeEnterBefore = time >= noEntryBeforeTime
    
    // Impedisce al sistema di piazzare nuovi ordini per entrare a mercato o aumentare la taglia della posizione dopo l'orario indicato
    noEntryAfterTime = 220000
    timeEnterAfter = time < noEntryAfterTime
    
    // Condizioni per entrare su posizioni long
    sopra =  highest[hh](high)
    c1 = (sopra > sopra[1])
    sotto = lowest[mm](low)
    
    c2 = (sotto >= sotto[1])
    // long se sopra aumenta rispetto alla barra primae sotto rimane uguale o aumenta rispetto alla barra prima
    IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter THEN
    BUY 1 CONTRACT AT MARKET
    ENDIF
    
    // Condizioni per entrare su posizioni short
    //(sopra) rimane uguale o diminuisce e sotto inizia a scendere rispetto a sotto alla barra prima
    c4 = (sotto < sotto[1])
    c5= sopra<=sopra[1]
    //c6= c5 and c2
    IF  c4 and c5 and timeEnterBefore AND timeEnterAfter then
     
    SELLSHORT 1 CONTRACT AT MARKET
    ENDIF
    //set stop ptrailing 50
    graphonprice sopra
    graphonprice sotto
    //uscire dallo short
    #78005 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Prova ad usare TRAILING senza la “p” iniziale, vedi https://www.prorealcode.com/documentation/trailing/.

    Alessio thanked this post
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

dax intraday da 5' a 30' trendfollowing,


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Alessio @alessio Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
8 years, 1 month ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 08/11/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...