COMPRAR HOY Y VENDER DENTRO DE 2 MESES

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #222640 quote
    josemijosemi
    Participant
    Average

    Hola a todos, alguien me puede ayudar con lo siguiente:

    Entrar corto/largo en una posición al comienzo de la vela.

    Salir de dicha operación al final de la vela.

    Teniendo en cuenta que la entrada sería hoy y la salida dentro de 2 meses.

    Gracias de antemano. Saludos.

    #222661 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    ¿Quiere ingresar una posición cualquier día y luego cerrarla después de 2 meses? ¿

    Qué plazo estás usando?

    #222677 quote
    josemijosemi
    Participant
    Average

    Si, por ejemplo sería entrar el 15 de enero y salir el 30 de marzo.

    En diario.

    #222836 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ahi esta:

    IF Not OnMarket THEN
       BUY AT MARKET
       exitMonth = OpenMonth + 2   //puedes reemplazar OpenMonth con Month
       IF exitMonth > 12 THEN
          exitMonth = exitMonth MOD 12
       ENDIF
    ENDIF
    IF OnMarket AND Month = exitMonth THEN
       SELL AT MARKET
    ENDIF
    #222840 quote
    josemijosemi
    Participant
    Average

    Hola de nuevo Robert, creo que no me expresé bien en mi consulta. Me gustaría saber cómo se escribe lo siguiente:

    -Entrar en una posición larga el 15 de enero al comienzo de la vela.

    -Salir de dicha operación al cierre de la vela el 30 de marzo.

    En timeframe DIARIO y/o en gráfico horario también.

    Gracias.

    #222842 quote
    robertogozzirobertogozzi
    Moderator
    Legend
    IF Not LongOnMarket AND (Month = 1 AND Day >= 15 )THEN
       BUY AT MARKET
    ENDIF
    IF LongOnMarket AND ((Month = 3 AND Day >= 30) OR (Month > 3)) THEN
       SELL AT MARKET
    ENDIF
Viewing 6 posts - 1 through 6 (of 6 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

COMPRAR HOY Y VENDER DENTRO DE 2 MESES


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
josemi @josemi Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by robertogozzirobertogozzi
2 years, 11 months ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 10/19/2023
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...