MULTI TIMEFRAME NO FUNCIONA

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #111804 quote
    galdargaldar
    Participant
    Average

    Hola, os agradecería si me pudieseis indicar cual es el error en el siguiente código, ya que lo valido pero no se ejecuta la estrategia.

    Es un código sencillo, con un filtro en semanal pero que opera en diario. Tengo la plataforma Prorealtime gratuita.

    Gracias.

    DEFPARAM CUMULATEORDERS=FALSE
    
    TIMEFRAME(WEEKLY,UPDATEONCLOSE)
    MYMEDIA=WeightedAverage[30](close)
    MYCON1=MYMEDIA>MYMEDIA[1]
    TIMEFRAME(DAILY)
    MYmacd=MACDline[12,26,9](close)
    MYCON2= MYMACD CROSSES OVER 0
    MYCON3=MYMACD CROSSES UNDER 0
    IF MYCON1 AND MYCON2 THEN
    BUY 1 CONTRACTS AT MARKET
    ENDIF
    If LongOnMarket AND MYCON3 THEN
    SELL AT MARKET
    ENDIF
    #111805 quote
    NicolasNicolas
    Keymaster
    Legend

    ¡El problema es que su condición para ingresar un pedido de COMPRA no puede ser válida! No es posible que el MACD cruce sobre (MYCON2) y debajo (MYCON3) la línea cero al mismo tiempo 🙂

    #111807 quote
    NicolasNicolas
    Keymaster
    Legend

    Lo siento, me confundí con los nombres de las variables. No veo un error de codificación en su programa. ¿Cuál es el instrumento con el que probaste el código, por favor? ¿Estás seguro de que MACDLine es el indicador que necesitas? No es MACD?

    #111825 quote
    galdargaldar
    Participant
    Average

    Muchas gracias por la rápida respuesta, he probado el código en el MiniSP500 y en el SPY, y en ninguno de los instrumentos se me ejecuta el código. No da ningún error, sino que no se ejecuta no ocurre nada.

    Debo activar alguna opción en prorealtime?

    Gracias.

    #111827 quote
    pableitorpableitor
    Participant
    Master

    He probado tu codigo con el NASDQ y si que abre operaciones ¿  es posible que tengas que pedir al broker que te active MTF ?.

    Captura.jpg Captura.jpg
    #111843 quote
    NicolasNicolas
    Keymaster
    Legend

    Asegúrese de tener suficientes unidades en su gráfico para calcular el promedio móvil semanal por completo.

    #111855 quote
    galdargaldar
    Participant
    Average

    Muchísimas gracias por su ayuda.

Viewing 7 posts - 1 through 7 (of 7 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

MULTI TIMEFRAME NO FUNCIONA


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
galdar @galdar Participant
Summary

This topic contains 6 replies,
has 3 voices, and was last updated by galdargaldar
6 years, 11 months ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 11/01/2019
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...