Distanza media e distanza chiusura.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #214756 quote
    Mauro MMauro M
    Participant
    New

    Salve non riesco a codificare questa idea. Se oggi ho una chiusura positiva maggiore ad esempio della media a 25 periodi. E questa chiusura  meno closed della media deve essere maggiore di 250 punti) allora entro short a x punti dalla closed di ieri. Spero di essere stato chiaro. Grazie

    #214767 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Con CLOSED intendi la chiusura? di quando?

    #214768 quote
    Mauro MMauro M
    Participant
    New

    Intendo la chiusura di ieri se questa sta distante dalla media oggi entro

    #215042 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ecco il codice:

    ONCE Entrata  = 0
    ONCE Xpunti   = 20
    ONCE Distanza = 10
    IF OnMarket THEN
       Entrata = 0
    ENDIF
    MM = average[25,0](close)
    IF (close > open) AND (close > MM) THEN
       Differenza = (abs(close - MM) / PipSize) > 250
       IF Differenza THEN
          Entrata = close[1] - (Xpunti * PipSize)
          //Entrata = close[1] + (Xpunti * PipSize)
       ENDIF
    ENDIF
    IF Entrata AND Not OnMarket THEN
       IF close > (Entrata + Distanza) THEN
          SELLSHORT 1 CONTRACT AT Entrata STOP
       ELSIF close < (Entrata - Distanza) THEN
          SELLSHORT 1 CONTRACT AT Entrata LIMIT
       ELSE
          SELLSHORT 1 CONTRACT AT MARKET
       ENDIF
    ENDIF
    SET STOP   pLOSS   300
    SET TARGET pPROFIT 600

    ho previsto anche la DISTANZA minima richiesta dal broker per gli ordini pendenti; ho messo 10 punti a caso, metti te quelli reali.

    Per il discorso della DISTANZA ho previsto che quando NON c’è la distanza minima entri A MERCATO. Se non desideri farlo, commenta la linea 21.

    Ho usato la linea 11 per il calcolo del prezzo d’entrata, usando il “-“, subito sotto ho aggiunto come commento la linea 12 dove c’è il “+”. Scegli te qual’è quella che intendevi.

    #215111 quote
    Mauro MMauro M
    Participant
    New

    Grazie.

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

Distanza media e distanza chiusura.


ProOrder: Trading Automatico & Backtesting

New Reply
Author
author-avatar
Mauro M @mauro-m Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Mauro MMauro M
3 years, 3 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 05/15/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...