piramidazione

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13414 quote
    maximus78maximus78
    Participant
    Senior

    Buongiorno, sto cercando di scrivere un codice di piramidazione con questi comandi, ma il sistema non esegue tutti i miei ordini.

    Come posso fare a dire di comprare nella prima posizione 4 contratti, nella seconda 3, nella terza 2 e nell’ultima 1 solo contratto?

    I comandi mi sembrano logici e chiari ma il sistema compra solo la prima posizione di 4 contratti ed ignora i successivi comandi.

    Grazie mille.

    Massimo

     

    Grazie

    //prima posizione long

    if not longonmarket and miecondizioni then buy 4 shares at market

    endif

    //seconda posizione long

    if countoflongshares < 4 and miecondizioni then buy 3 shares at market

    endif

    //terza posizione long

    if countoflongshares < 3 and miecondizioni then buy 2 shares at market

    endif

    //quarta posizione long

    if countoflongshares < 2 and miecondizioni then buy 1 shares at market

    endif

    // chiusure posizioni long

    if longonmarket and miecondizioni then sell at market

    #13430 quote
    NicolasNicolas
    Keymaster
    Legend

    Perché hai fatto il confronto sbagliato, si sta testando se i “COUNTOFLONGSHARES” è inferiore alla tua attuale posizione sul mercato. Si dovrebbe verificare se è uguale, invece! 🙂

    //prima posizione long  
    if not longonmarket and miecondizioni then 
     buy 4 shares at market
    endif  
    //seconda posizione long (0+4=4) 
    if countoflongshares = 4 and miecondizioni then 
     buy 3 shares at market  
    endif  
    //terza posizione long  (4+3=7)
    if countoflongshares = 7 and miecondizioni then 
     buy 2 shares at market  
    endif  
    //quarta posizione long  (7+2=9)
    if countoflongshares = 9 and miecondizioni then 
     buy 1 shares at market  
    endif  
    
    #13510 quote
    maximus78maximus78
    Participant
    Senior

    Ah già hai ragione!

    ed io consideravo i longshares come trades e non come lotti!

    Thanks a lot!!

    Massimo

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

piramidazione


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
maximus78 @maximus78 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by maximus78maximus78
10 years ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/21/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...