domanda su defparam flatbefore e flatafter

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #39438 quote
    iceman89iceman89
    Participant
    Average

    E’ possibile mettere nel codice DEFPARAM flatAfter e flatBefore separati sia per gli acquisti che per le vendite?

    #39443 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    No, non è possibile, ma puoi usare TIME per fare questo lavoro. Esempio:

       .
       .
       .
    ONCE InizioLong  = 090000                                        //iniziare i LONG solo dalle 09:00:00 in poi
    ONCE FineLong    = 160000                                        //niente più LONG dopo le    16:00:00
    ONCE InizioShort = 084500                                        //iniziare gli SHORT solo dalle 08:45:00 in poi
    ONCE FineShort   = 170000                                        //niente più   SHORT dopo le    17:00:00
       .
       .
       .
    IF condizioni AND time >= InizioLong AND time < FineLong THEN    //LONG solo nell'intervallo orario di cui sopra
        BUY 1 contract at market
    ENDIF
       .
       .
       .
    IF condizioni AND time >= InizioShort AND time < FineShortTHEN   //SHORT solo nell'intervallo orario di cui sopra
        SELLSHORT 1 contract at market
    ENDIF
       .
       .
       .
    IF time = FineLong THEN                                          //Chiudere le posizioni LONG all'ora stabilita
       IF LongOnMarket THEN
          SELL at market
       ENDIF
    ENDIF
       .
       .
       .
    IF time = FineShort THEN                                         //Chiudere le posizioni SHORT all'ora stabilita
       IF ShortOnMarket THEN
          EXITSHORT at market
       ENDIF
    ENDIF
       .
       .
       .
    

    Potresti combinare anche TIME con i giorni per creare orari diversi secondo i giorni della settimana ecc…

    #39467 quote
    iceman89iceman89
    Participant
    Average

    GRazie mille è questo che volevo e per inserirgli anche i giorni che voglio?

    #39469 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Puoi usare

    CurrentDayOfWeek

    ad ogni modo a questo link ci sono tutte le indicazioni utili https://www.prorealcode.com/documentation/category/dateandtime/

    Puoi anche utilizzare la barra GOOGLE Search in alto nell’area blu, accanto ad HELP. Con quella trovi qualunque cosa compaia all’interno del sito ProRealCode, manuale istruzioni, esempi, strategie, ecc… Quindi indicando, ad esempio, DAX, trovi ogni cosa ci sia sul DAX (Ger30).

    Nicolas thanked this post
Viewing 4 posts - 1 through 4 (of 4 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 su defparam flatbefore e flatafter


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
iceman89 @iceman89 Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 06/29/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...