Problemas con un Multi-Frame

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #126185 quote
    Albert0769
    Participant
    Average

    Buenas noches:

     

    He desarrollado esta esta estrategia que creo que puede funcionar más o menos bien (he calculado que puedes ganar más del doble que las perdidas), pero el código para trading automático (ProOrder) no se corresponde en el tiempo con el mismo código para su grafico visual (ProBuilder).

    Yo utilizo ambos códigos para el futuro del Índice Dow Jones (Wall Street Cash) que es el nombre que utiliza el bróker IG.

    A ver si alguno de vosotros lo puede probar unos días en la DEMO para ver los desfases que existen entre el código para ProOrder y el código para Probuilder, y darme alguna solución, yo personalmente creo que todo está bien codificado, pero no me funciona correctamente, ya veréis que entre los dos códigos, existe un desfase en las líneas de entrada y de salida de las órdenes para el trading automático.

     

    Gracias a todos por vuestra ayuda.

    DEFPARAM PRELOADBARS = 5000
    DEFPARAM CUMULATEORDERS = False
    
    
    Timeframe (5 Minutes)
    
    if Time = 010000  then
    startbar=Barindex
    endif
    if Time >= 010000  then
    BAR00=Barindex-startbar
    endif
    
    if Time = 143500  then
    startbar1=Barindex
    endif
    if Time >= 143500  then
    BAR00=Barindex-startbar1
    endif
    
    MMDIARIO5 = Average[max(1,BAR00)](Volume)
    
    
    PRECIO5 = Close
    
    
    MASALTO = Highest[276](High)
    
    IF MASALTO = High  THEN
    HIGH1 = High
    ENDIF
    
    IF HIGH1 = HIGH1[1]  THEN
    VARV1 = Barindex
    ENDIF
    VARV2 = Barindex-VARV1
    
    IF VARV2 >= 0  THEN
    STOPVENTAS1 = HIGH1[1]
    ENDIF
    
    VELAENTRADA = Volume > MMDIARIO5
    IF VELAENTRADA[1] AND VELAENTRADA AND STOPVENTAS1 > STOPVENTAS1[1] AND PRECIO5 CROSSES UNDER STOPVENTAS1  THEN
    LINEAHV = High
    ENDIF
    
    
    
    Timeframe (default)
    
    
    PRECIO = Close
    
    
    IF PRECIO CROSSES OVER STOPVENTAS1  THEN
    EXITSHORT AT MARKET
    ENDIF
    
    
    IF PRECIO CROSSES UNDER LINEAHV  THEN
    SELLSHORT 1 CONTRACTS AT MARKET
    ENDIF
    
    
    //startBreakeven = 150
    //PointsToKeep = 0
    //IF NOT ONMARKET THEN
    //breakevenLevel = 0
    ////ENDIF
    
    //IF SHORTONMARKET AND TradePrice(1)-Close >= startBreakeven*Pointsize  THEN
    //breakevenLevel = TradePrice(1)-PointsToKeep*Pointsize
    ////ENDIF
    
    //IF breakevenLevel > 0  THEN
    //EXITSHORT AT breakevenLevel STOP
    ////ENDIF
    
    
    //// Stops y objetivos:
    
    SET STOP pLOSS 100
    SET TARGET pPROFIT 200
    
    0-A1-VENTA-TF-1-Segundo.itf 0-A-C-V-TF-TOTAL-AÑO.itf
    #145348 quote
    Nicolas
    Keymaster
    Master

    ¿Cómo se compara la señal que da la estrategia en tiempo real con lo que está haciendo el código en vivo? Dado que está utilizando la instrucción MTF, tenga en cuenta que está utilizando los valores del marco de tiempo de 5 minutos en barras que aún no están cerradas (durante la barra), por lo que si compara el gráfico posteriormente, verá barras que están cerradas y no qué sucedió dentro de ellos! Si desea utilizar la barra cerrada, debe agregar "updateonclose" en sus instrucciones de tiempo.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Problemas con un Multi-Frame


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
Albert0769 @albert0769 Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by Nicolas
5 years, 5 months ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 04/14/2020
Status: Active
Attachments: 2 files
Logo Logo
Loading...