4 posizioni massime in intraday

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #46034 quote
    Carl
    Participant
    Average

    Di seguito è riportata una richiesta inviata a ProRealTime:

    Buongiorno, ho un altro quesito.
    Mi servirebbe il codice che apra un numero di posizioni intraday non cumulative (cioè non quando è già aperta una posizione).

    Per esempio voglio aprire solo 4 posizioni in intraday, ma solo dopo che sia chiusa quella precedente. Quando raggiunto il n° 4 posizioni avute il sistema si sospende fino al giorno successivo.

    Per esempio,

    entrata=close>highest[10](high)[1]
    uscita=close<lowest[5](low)[1]

    if not longonmarket and entrata then
    buy 1 shares at market

    if longonmarket and uscita then
    sell at market

    Mi servirebbe il codice che dica al sistema di aprire e chiudere un massimo di 4 trades intraday, uno successivo l’altro.

    grazie mille e buona giornata.

    E una proposta per una risposta:

    entrata=close>highest[10](high)[1]
    uscita=close<lowest[5](low)[1]
    
    if intradaybarindex = 0 then
    countposition=0
    endif
    
    condnbposperday=countposition < 4
    
    if not longonmarket and entrata and condnbposperday then
    buy 1 shares at market
    countposition=countposition+1
    endif
    
    if longonmarket and uscita then
    sell at market
    endif
    Nicolas thanked this post
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

4 posizioni massime in intraday


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Carl @carl Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 09/12/2017
Status: Active
Attachments: No files
Logo Logo
Loading...