Entrada y salida con velas HEIKIN ASHI

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #228433 quote
    gustavobp
    Participant
    New

    Buenos días!

    Estoy intentando crear una estrategia automática de Trading en ProOrder en la cual haga una entrada Long cuando haya 2 velas consecutivas verdes (HEIKIN ASHI) en la cuales el Open de dichas 2 velas sea igual al Low, es decir que en definitiva estas 2 velas verdes no tengan Low, y que luego simplemente cierre la operación abierta totalmente cuando se detecte una vela (HEIKIN ASHI) roja que tenga su mínimo Low igual o menor al mínimo Low de la vela HEIKIN ASHI anterior.

    muchas gracias!,

    #228444 quote
    Iván González
    Moderator
    Master

    Hola

    Aquí tienes:

     

    defparam cumulateorders = false
    ///////Heikin Ashi
    once haopen=open
    haclose=(open+close+high+low)/4
    if barindex> 0 then
    haopen=(haopen+haclose[1])/2
    endif
    halow=min(low,min(haclose,haopen))
    hahigh=max(high,max(haclose,haopen))
    ////////long
    ///buy
    c1 = summation[2](haclose>haopen) > 1
    c2 = summation[2](haopen=halow) > 1
    
    if c1 and c2  then
    buy 1 lot at market
    endif
    
    ///sell
    s1 = haclose < haopen
    s2 = halow <= halow[1]
    
    if s1 and s2 then
    sell at market 
    endif
    
    #228488 quote
    gustavobp
    Participant
    New

    Muchas gracias !!!!!!  Fantástico código!!! Solo por poder optimizarle un pequeño detalle, ¿Sería posible por favor agregarle a este mismo código que en lugar de cerrar la posición con una orden Sell Market cuando alguna vela toque el mínimo Low de la vela anterior, que sea que al mismo momento de abrir la posición LONG se abra automáticamente una orden Stop Limit de protección al mismo precio del Low de la vela anterior a la apertura de la posición, e ir moviendo dicho Stop Limit de protección con cada CLOSE de las velas consecutivas siguientes y así sucesivamente moviendo el Stop Limit al mínimo de la vela anterior con cada nueva vela, hasta que en definitiva alguna vela sea de bajada y salga de la posición tocando dicha orden Stop Limit ubicado siempre en la vela anterior. Muchas graciassssss!!!!!

    #228811 quote
    Iván González
    Moderator
    Master

    Buenas
    Sería algo así:

    defparam cumulateorders = false
    ///////Heikin Ashi
    once haopen=open
    haclose=(open+close+high+low)/4
    if barindex> 0 then
    haopen=(haopen+haclose[1])/2
    endif
    halow=min(low,min(haclose,haopen))
    hahigh=max(high,max(haclose,haopen))
    ////////long
    ///buy
    c1 = summation[2](haclose>haopen) > 1
    c2 = summation[2](haopen=halow) > 1
    
    if not longonmarket and c1 and c2  then
    buy 1 lot at market
    sellprice = low
    set stop price sellprice
    endif
    
    if low > low[1] then
    sellprice = low
    set stop price sellprice
    endif
    
    graphonprice sellprice
    #228814 quote
    gustavobp
    Participant
    New

    Buenas Ivan, si es que eres un crack , todo hay que decirlo!! Una cosita mas!!! Despues de poner la orden de SELL para cerrar la posicion, me gustaria para que no falte redundancia de seguridad y estar seguro de que no me quede ninguna orden abierta, hacer una “limpieza” de todas las ordenes que puedan estar pendientes de ejecucion, es decir algo asi:

    condicon de compra x

    BUY 1 CONTRACT AT MARKET ////ABRO POSICION

    CONDION DE SALIDA:

    SELL 1 CONTRACT AT MARKET // CIERRO LA POSICION

    COMANDO PARA CERRAR TODAS LAS ORDENES QUE PUEDAN HABER POENDIENTES DESPUES DEL SELL //AQUI NO SE QUE COMANDO AGREGAR ¿QUE COMANDO SERIA??

    MUCHAS GRACIAS CRACK!!!

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

Entrada y salida con velas HEIKIN ASHI


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
gustavobp @gustavobp Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by gustavobp
1 year, 11 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 02/20/2024
Status: Active
Attachments: No files
Logo Logo
Loading...