máximo y mínimo de vela marcan señales de largos y cortos

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #192798 quote
    MaikelNait
    Participant
    New

    Buenos días,

    me encuentro trabajando en la creación de un nuevo sistema para aplicar en la apertura europea. Para ello, necesito ayuda para poder codificar la siguiente orden:

    Una vela determinada (por ejemplo la vela de las 9:00h), marca, con su máximo, un precio/nivel de entrada. Cualquiera de las siguiente 25 velas que cierre por encima de ese precio marca una señal de entrada de largos de X contratos.

    Para cerrar largos, cualquiera de las siguientes 50 velas que cierre por debajo del mínimo de la vela de las 9:00h, marcará el cierre de los largos.

    Gracias de antemano por vuestra ayuda.

    Saludos.

    #192809 quote
    robertogozzi
    Moderator
    Master

    Ahi esta:

    DEFPARAM CumulateOrders = FALSE
    ONCE OpeningTime = 090000
    ONCE Tally       = 0
    ONCE EntryPrice  = 0
    IF OpenTime <= OpeningTime THEN
       EntryPrice = 0
       ExitPrice  = 0
    ENDIF
    IF OpenTime = OpeningTime THEN
       IF OnMarket THEN
          SELL AT MARKET
       ENDIF
       EntryPrice = high
       ExitPrice  = low
       Tally      = 0
    ENDIF
    IF OpenTime > OpeningTime THEN
       Tally = Tally + 1
    ENDIF
    IF Not OnMarket AND Tally <= 25 AND EntryPrice > 0 THEN
       IF close > EntryPrice THEN
          BUY 1 CONTRACT AT MARKET
          Tally = 0
       ENDIF
    ENDIF
    IF OnMarket AND ((close < ExitPrice) OR (Tally >= 50)) THEN
       SELL AT MARKET
    ENDIF
    MaikelNait thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

máximo y mínimo de vela marcan señales de largos y cortos


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
MaikelNait @maikelnait Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
3 years, 10 months ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 05/06/2022
Status: Active
Attachments: No files
Logo Logo
Loading...