Ordinii cumulativi e prezzo medio

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #134621 quote
    volpiemanuelevolpiemanuele
    Participant
    Veteran
    DEFPARAM CumulateOrders=true
    
    Pipstep=40
    Piputile= 25
    count = 0
    maxcount = 3
    
    Candelalong= ((close-open)*pipsize)
    Candelashort =((open-close)*pipsize)
    
    if Not shortonmarket and candelalong > pipstep and count <= maxcount then
    BUY 1 CONTRACTS AT MARKET
    obiettivo = positionprice + (piputile*pipsize)
    count = count + 1
    endif
    
    if Not longonmarket and Candelashort > pipstep and count <= maxcount then
    SELLSHORT 1 CONTRACTS AT MARKET
    obiettivo1 = positionprice + (piputile*pipsize)
    count = count + 1
    endif
    
    timeframe (5 minutes)
    if longonmarket and  close >= obiettivo then
    SELL AT MARKET
    count = 0
    
    endif
    
    if shortonmarket and close <= obiettivo1 then
    EXITSHORT AT MARKET
    count = 0
    ENDIF
    

    Il seguente sistema dovrebbe funzionare cosi ma non funziona:

    • time frame principale H4;
    • Se la dimensione della candela (chiusura – apertura) è maggiore di pipstep entra;
    • Alla chiusura di ogni candela se avverata la condizione precedente aggiunge una posizione; ovvio che se alla prima entrata raggiunge il TP si inizia da capo;
    • Posizione massime 3 (variabile maxcount)
    • Chiusura della posizione pari al prezzo medio + piputile;
    • Controllo per uscire su time frame 5 minuti.

    Ho provato a modificare il sistema in vari modi ma ci sono diverse cose che non vanno bene. Mi potete aiutare ?

    Grazie

    #134632 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Hai fatto un pò di confusione con PIPSIZE. Alle righe 19 e 13 va bene, perché devi convertire un valore di pips numerico in prezzo, ma alle righe  8 e 9 è l’opposto, devi convertire un prezzo (in questo caso una differenza di prezzo) in pips, quindi devi dividere e non moltiplicare per PIPSIZE.

    Comunque se hai provato sul Dax o simili strumenti con rapporto pip:prezzo di 1:1 non è questo il motivo di malfunzionamento (resta comunque un errore logico da correggere).

    Alla riga 19 occorre il “-“ perché devi sottrarre per trovare l’obiettivo.

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

Ordinii cumulativi e prezzo medio


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzirobertogozzi
6 years, 3 months ago.

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