Codice per apertura inizio barra/Chiusura fine barra

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

    Ciao,

    sono nuovo di PRT e sto provando a codificare un sistema attraverso il quale ottenere un’analisi oraria di come si comporta il mercato.

    In sostanza il sistema dovrà fare questo:

    • aprire una posizione all’apertura della barra X e chiudere la stessa posizione alla chiusura della barra in questione
    • Ciclare su tutte le barre della giornata
    • Ripetere l’operazione per tutti i giorni inclusi nel backtest.

    Quello che mi aspetto, alla fine, è avere le info per costruire un istogramma che mi consenta di sapere quali sono gli orari più profittevoli per le operazioni long/short

    Qualcuno saprebbe aiutarmi?

    grazie mille

    #219580 quote
    robertogozzi
    Moderator
    Master

    Questa strategia entra LONG alle 110000 e chiude alle 115900:

    DEFPARAM CumulateOrders = false
    Timeframe(1h,UpdateOnClose)
    IF Time = 110000 AND Not OnMarket THEN
       BUY at Market
    ENDIF
    //
    Timeframe(1mn,default)
    IF OnMarket AND hour <> hour[1] THEN
       SELL at Market
    ENDIF

    devi eseguirla da un grafico con il timeframe di 1 minuto.

    banjoo78 thanked this post
    #219713 quote
    banjoo78
    Participant
    New

    Grazie Roberto!

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

Codice per apertura inizio barra/Chiusura fine barra


ProBuilder: Indicatori & Strumenti Personalizzati

New Reply
Author
author-avatar
banjoo78 @banjoo78 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicatori & Strumenti Personalizzati
Language: Italian
Started: 08/23/2023
Status: Active
Attachments: No files
Logo Logo
Loading...