ordini chiusi a fine giornata

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #253319 quote
    Tommaso._r0ma
    Participant
    New

    Salve, non riesco a mettere in pratica questa idea. Se la candela delle 14.30 viene superata al rialzo il sistema inserisce un ordine al ribasso sul minimo della candela delle 14.30 e viceversa entra con un contratto stop profit 300 punti stop loss 50. Deve fare un solo ordine al giorno se non entra a fine giornata cancella gli ordini pendenti

    #253329 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    OTD = (Barindex - TradeIndex(1) > IntradayBarIndex)  // One Trade per Day
    IF (OpenTime = 143000) THEN
       HI         = high
       LO         = low
       TradeLONG  = 0
       TradeSHORT = 0
    ENDIF
    IF OTD AND ((TradeSHORT + TradeLONG) = 0) AND (OpenTime > 143000) THEN
       IF close > HI THEN
          TradeSHORT = 1
       ELSIF close < LO THEN
          TradeLONG  = 1
       ENDIF
    ENDIF
    IF OTD AND Not OnMarket THEN
       IF TradeLONG  THEN
          BUY 1 CONTRACT AT MARKET
       ELSIF TradeSHORT THEN
          SELLSHORT 1 CONTRACT AT MARKET
       ENDIF
    ENDIF
    SET STOP   pLOSS   50
    SET TARGET pPROFIT 300
    Iván González thanked this post
    #253334 quote
    Tommaso._r0ma
    Participant
    New

    Grazie della risposta, ma provandolo su prorealtime risulta errato.

    Allego esempio

    La posizione a sinistra è stata aperta 20 punti sotto il low delle 14 e 30, mentre doveva essere aperta sopra l’high delle 14 e 30.

    il sistema esegue un ordine long alle 00:30 senza motivo.

    #253335 quote
    Gabriele Battista
    Participant
    Senior

    Su che time frame dovrebbe operare? candela delle 14:30 intendi che chiude a quell’ora?

    #253351 quote
    robertogozzi
    Moderator
    Master

    Grazie della risposta, ma provandolo su prorealtime risulta errato.

    Dimmi su quale strumento, timeframe, data ed ora, oppure allega una foto da cui si vedano chiaramente questi dati.

    #253352 quote
    Tommaso._r0ma
    Participant
    New

    Sul nasdaq a 15 minuti

    Gabriele Battista thanked this post
    #253360 quote
    Gabriele Battista
    Participant
    Senior

    prova a mettere high e low anzichè close nelle righe 9 e 11. nel codice postato la condizione è verificata sul close, ti serve sul max/min?

    #253363 quote
    Tommaso._r0ma
    Participant
    New

    Si mi serve che quando il prezzo supera l’high della candela che chiude alle 14 e 30 il sistema piazzi un ordine short sul low della candela che chiude alle 14 e 30. Viceversa per il long, quindi quando il prezzo supera il low della candela che chiude alle 14 e 30 il sistema piazzi un ordine short sull’high della candela che chiude alle 14 e 30.

    Se gli ordini non vengono eseguiti vengono eliminati a fine giornata e le posizioni devono essere chiuse dopo 2 candele.

    Inoltre se ad esempio il prezzo stamattina superasse l’high delle 14 e 30 di ieri non deve essere piazzato nessun ordine, cosa che succedeva invece nel primo codice che mi hai mandato.

    #253370 quote
    Gabriele Battista
    Participant
    Senior

    prova questo

    #253372 quote
    Tommaso._r0ma
    Participant
    New

    Riusciresti a scrivermelo qui nel forum che non mi fa accedere al file?

    #253568 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    OTD = (Barindex - TradeIndex(1) > IntradayBarIndex)  // One Trade per Day
    IF (OpenTime = 143000) THEN
       HI         = high
       LO         = low
       TradeLONG  = 0
       TradeSHORT = 0
    ENDIF
    IF OTD AND ((TradeSHORT + TradeLONG) = 0) AND (OpenTime > 143000) THEN
       //IF high > HI THEN
       IF close > HI THEN
          TradeSHORT = 1
       //ELSIF low < LO THEN
       ELSIF close < LO THEN
          TradeLONG  = 1
       ENDIF
    ENDIF
    IF OTD AND Not OnMarket THEN
       //IF TradeLONG and high>HI THEN
       IF TradeLONG and close>HI THEN
          BUY 1 CONTRACT AT MARKET
       //ELSIF TradeSHORT and LOW<LO THEN
       ELSIF TradeSHORT and close<LO THEN
          SELLSHORT 1 CONTRACT AT MARKET
       ENDIF
    ENDIF
    SET STOP   pLOSS   50
    SET TARGET pPROFIT 300

    questo usa il prezzo di chiusura (CLOSE) invece di HIGH e LOW.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

ordini chiusi a fine giornata


ProOrder: Trading Automatico & Backtesting

New Reply
Author
Summary

This topic contains 10 replies,
has 3 voices, and was last updated by robertogozzi
2 months, 4 weeks ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 11/05/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...