Come limitare il trading ad un intervallo di tempo

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #128420 quote
    Flo66Flo66
    Participant
    Junior

    Buongiorno a tutti vorrei  impostare l’orario sul mio trading automatico  dalle 8:00 di mattina fino alle 20.00 di sera come posso fare ?

    Grazie

    #128422 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ti aiutiamo volentieri, però devi leggere le regole e ricordarle!

    In pochi giorni ne hai ignorate diverse!

    Dai un titolo significativo al tuo argomento. Descrivi la tua domanda o l’oggetto nel titolo. Non utilizzare titoli privi di significato come “Aiuto per la codifica”.

    Grazie:)

    #128424 quote
    Flo66Flo66
    Participant
    Junior

    Ok

    #128425 quote
    Flo66Flo66
    Participant
    Junior

    Scusatemi

    #128426 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Devi stabilire una condizione temporale che userai quando devi entrare a mercato:

    TimeCond = Time >= 080000 and Time <= 200000
    If MieCondizioni and TimeCond and not OnMarket then
       Buy 1 contract at market
    endif
    
    #128427 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Questo ti impedisce di aprire posizioni al di fuori dall’intervallo 8-20, ma lascia aperte le posizioni in corso.

    Se alle 20 vuoi chiudere tutte le posizioni aperte devi aggiungere:

    If Time >= 200000 then
       Sell at market
       Exitshort at market
    Endif
    #128433 quote
    Flo66Flo66
    Participant
    Junior

    Ok grazie ma questi parametri  in che punto del codice devo inserirli?

    #128439 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    All’inizio, dopo i vari DEFPARAM (se ne usi qualcuno).

    Ad ogni modo fai qualche prova.

    #128446 quote
    Flo66Flo66
    Participant
    Junior

    Ok grazie della disponibilità

    #128530 quote
    Flo66Flo66
    Participant
    Junior

    Buongiorno vorrei sapere se è possibile, siccome ho trovato un codice, sapere cosa fa esattamente e quando entra a mercato e perché, Grazie

    #128533 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Va bene, se posso ti aiuto.

    #128536 quote
    Flo66Flo66
    Participant
    Junior

    Eccolo

    defparam cumulateorders = true
    
    av1 = average[3](close)
    av2 = average[20](close)
    av3 = average[50](close)
    //x = 0.5
    bull = close> av1 and close >av2 and close > av3
    bear = close <av1 and close <av2 and close <av3
    //n= 1
    
    If (high-low) = 0 Then
    HiLo = 1
    Else
    HiLo = (high-low)
    EndIf
    
    hammerupnegated= max(open,close)<min(open[1],close[1]) and (abs(open-close)/max(pointsize,HiLo))>0.5
    
    hammerup = min(open[1],close[1])>high[1]-(high[1]-low[1])/3 //and timeok
    hammerupnegated= max(open,close)<min(open[1],close[1]) and (abs(open-close)/max(pointsize,HiLo))>0.5
    cs = hammerup and hammerupnegated and bear
    hammerdown = max(open[1],close[1])<low[1]+(high[1]-low[1])/3 //and timeok
    hammerdownnegated = min(open,close)>max(open[1],close[1]) and (abs(open-close)/max(pointsize,HiLo))>0.5
    cl = hammerdown and hammerdownnegated and bull
    
    if cs and not onmarket then
    sellshort 0.25 contract at market
    endif
    
    if cl and not onmarket then
    buy 0.25 contract at market
    endif
    
    //TRAILING STOP
    TGL =25
    TGS= 25
    if not onmarket then
    MAXPRICE = 0
    MINPRICE = close
    PREZZOUSCITA = 0
    ENDIF
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close)
    if MAXPRICE-tradeprice(1)>=TGL*pointsize then
    PREZZOUSCITA = MAXPRICE-TGL*pointsize
    ENDIF
    ENDIF
    if shortonmarket then
    MINPRICE = MIN(MINPRICE,close)
    if tradeprice(1)-MINPRICE>=TGS*pointsize then
    PREZZOUSCITA = MINPRICE+TGS*pointsize
    ENDIF
    ENDIF
    if onmarket and PREZZOUSCITA>0 then
    EXITSHORT AT PREZZOUSCITA STOP
    SELL AT PREZZOUSCITA STOP
    ENDIF
    
    SET STOP ploss 25
    SET TARGET pPROFIT 75
    #128545 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Io posso darti una mano, nei limiti del mio tempo, però se non smetti di ignorare le regole d’ora in poi ti cancellerò i post che scrivi, invitandoti a riscriverli correttamente.

    usa sempre il pulsante “Inser PRT code” quando inserisci il codice nei tuoi post per facilitare la lettura degli altri. Grazie:)

    Inoltre cerca di evitare di scrivere il codice in un post e in un altro scrivere solo Eccolo.

    Quando pubblichi il post hai 5 minuti per poterlo correggere, se hai sbagliato o dimenticato qualcosa, basta che tu clicchi su EDIT.

    #128547 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Non c’è scritto niente dove l’hai trovato?

    Comunque cerca il pattern HAMMER ed entra in direzione opposta se il prezzo è sotto o sopra le tre medie.

    Le linee da 34 a 57 sono il trailing stop.

    #128554 quote
    Flo66Flo66
    Participant
    Junior

    Me lo ha dato un mio amico

Viewing 15 posts - 1 through 15 (of 15 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

Come limitare il trading ad un intervallo di tempo


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Flo66 @flo66 Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 04/27/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...