entrata su massimo o minimo di un determinato periodo di tempo

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #182077 quote
    paolosab69paolosab69
    Participant
    Junior

    Salve, Vorrei creare un ts che entri sul max o min della sessione che va dalle 00.00 alle 08.00. In pratica alle 8 dovrebbero partire due ordini, uno che compra se viene toccato il max della sessione, e uno che vende se viene toccato il minimo della sessione. Grazie.

    #182094 quote
    MauroProMauroPro
    Participant
    Veteran

    Questa è la formula base che si usa per comperare\vendere breakout di range temporali.

    DEFPARAM cumulateOrders = false

    startHour = 080000

    cTime = time >= startHour  // inizio dell’operatività

    //——————————————————

    if openTime = 000000 then

    myHighest = high

    myLowest = low

    endif

    if openTime >= 000000 and openTime <=080000 then   // range temporale

    myHighest = max (myHighest,high)

    myLowest = min (myLowest,low)

    endif

    //————————————————————–

    if not onMarket and cTime then

    buy 1 contract at myHighest + (1*pointSize) stop

    sellShort 1 contract at myLowest – (1*pointSize) stop

    endif

    robertogozzi thanked this post
    #182152 quote
    paolosab69paolosab69
    Participant
    Junior

    Grazie!!!

    #182161 quote
    paolosab69paolosab69
    Participant
    Junior

    Ciao. Ho inserito tp e sl ed ho provato su time frame 15 minuti.   Funziona, però io vorrei fare solo un’operazione al giorno, cioè se raggiunge il TP non opera piu’ e si mette flat fino al giorno dopo. Sarebbe possibile? Grazie.

    #182162 quote
    MauroProMauroPro
    Participant
    Veteran

    singolaOperazione = barIndex – tradeIndex(1) > intradayBarIndex

    Basta che aggiungi ” singolaOperazione” alle tue condizioni di entrata per ottenere una singola operazione al giorno.

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

entrata su massimo o minimo di un determinato periodo di tempo


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
paolosab69 @paolosab69 Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 11/22/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...