Aiuto per sistema h1

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

    Non sono pratico per i sistemi in intraday.

    Vorrei avere una mano per questo codice in h1.

    Allo scattare delle ore 9 alla chiusura della candela di questo orario il mio sistema inserisce due ordini uno long e uno short .   Dalla chiusura (della candela  delle 9)+50 punti per il long , sempre dalla chiusura -50 punti. Stop profit 100 punti stop loss 50 punti. Se i targhet non vengno raggiunti chiudo il giorno dopo alle ore 8. Grazie

    #218379 quote
    robertogozzi
    Moderator
    Master

    Eccolo:

    IF OnMarket AND Time = 080000 THEN
       SELL      AT MARKET
       EXITSHORT AT MARKET
    ENDIF
    IF OpenTime = 090000 THEN
       Prezzo = close
    ENDIF
    IF (OpenTime >= 090000) AND Not OnMarket THEN
       BUY       1 CONTRACT AT Prezzo + 50*PipSize STOP
       SELLSHORT 1 CONTRACT AT Prezzo - 50*PipSize STOP
    ENDIF

    ovviamente puoi usarlo con un Grafico che abbia un Timeframe uguale o minore di 1 ora e che abbia le candele che aprono/chiudono alle 080000 e 090000.

    #218479 quote
    Mauro M
    Participant
    New

    Grazie Roberto.👍

    #218893 quote
    Mauro M
    Participant
    New

    Roberto e se ad esempio stabilisco che il sistema come scritto sopra alle ore 9 inserisse due ordini uno long al massimo delle candele precedenti della giornata e uno short al minimo delle candele precedenti della stessa giornata? Questa ultima parte non la so fare

    #218899 quote
    robertogozzi
    Moderator
    Master

    Occorre salvare in due variabili il Massimo ed il Minimo tra le ore 000000 e le 090000, poi usare que due prezzi per l’entrata. Eccolo:

    ONCE Massimo = 0
    ONCE Minimo  = 0
    IF OnMarket AND Time = 080000 THEN
       SELL      AT MARKET
       EXITSHORT AT MARKET
    ENDIF
    IF (OpenTime = 000000) OR ((OpenTime > 000000) AND (OpenTime[1] > OpenTime)) THEN
       Massimo = high
       Minimo  = low
    ENDIF
    IF (OpenTime >= 0) AND (OpenTime <= 090000 THEN
       Massimo = max(Massimo,high)
       Minimo  = min(Minimo,low)
    ENDIF
    IF (OpenTime >= 090000) AND Not OnMarket THEN
       BUY       1 CONTRACT AT Massimo + 50*PipSize STOP
       SELLSHORT 1 CONTRACT AT Minimo  - 50*PipSize STOP
    ENDIF
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Aiuto per sistema h1


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 robertogozzi
2 years, 6 months ago.

Topic Details
Forum: ProOrder: Trading Automatico & Backtesting
Language: Italian
Started: 07/30/2023
Status: Active
Attachments: No files
Logo Logo
Loading...