Chiusura più bassa

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

    Salve,

    sono nuovo e grazie se mi aiuterete.

    Sto cercando di capire creare una funzione che dica:

    Rispetto al momento attuale prendi la chiusura più bassa delle ultime 3 candele precedenti ed esegui un ordine al prezzo più basso della chiusura individuata di almeno X%.

    Spero di essermi spiegato.

    Grazie

    #63143 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ecco il codice, che adatterai alle tue esigenze.

    Tieni presente  che gli ordini LIMIT/STOP valgono solo per UNA candela, alla chiusura della quale vengono rimossi. Se vuoi tenerli ancora devi inserirli di nuovo (per ogni candela, fincé lo desideri).

    PrezzoMinimo  = lowest[3](low)                         //Prezzo più basso delle ultime 3 candele
    PrezzoEntrata = PrezzoMinimo - (PrezzoMinimo * 0.01)   //Prezzo d'entrara = Prezzo più basso - 10% (o + 10%, dipende
                                                           //    se vuoi entrare il 10% più basso o più alto)
    SELLSHORT 1 CONTRACT AT PrezzoEntrata STOP             //ordine pendente se vuoi vendere
    BUY       1 CONTRACT AT PrezzoEntrata LIMIT            //ordine pendente se vuoi acquistare

    Roberto

    Nicolas thanked this post
    #63181 quote
    ironshirowironshirow
    Participant
    Average

    Ciao,

    ti ringrazio ma allora come faccio ad aggiungere a questa parte di codice la ciclicità di aprire una posizione in rialzo e una in ribasso ad ogni chiusura candela?

    Ciao

    #63184 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Devi impostare le tue condizioni ed inserire BUY/SELLSHORT solo se sono vere e fino a quando continuano ad essere vere, usando IF…ENDIF.

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

Chiusura più bassa


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
ironshirow @ironshirow Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 02/19/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...