definir profit y stop

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #221620 quote
    Antuan
    Participant
    Senior

    hola buenas, quiero definir un profit y un stop para la estrategia cuando se da  el punto de entrada, seria lo siguiente: stoch 14.2.1.. profit al cierre por encima (en compra) de 80 y (en venta ) por debajo de 20, sin antes tocar el precio , no al cierre, el minimo (en compra )o el maximo (en venta) de 5 o 6 velas atras.

    prorealcode-compra.jpg prorealcode-compra.jpg prorealcode-venta-fail.jpg prorealcode-venta-fail.jpg prorealcode-3.jpg prorealcode-3.jpg
    #221634 quote
    Antuan
    Participant
    Senior

    a ver si Nicolas o Robertogozzi saben dar con la tecla

    #221658 quote
    robertogozzi
    Moderator
    Master

    ¿Qué significan las siguientes oraciones?

    1. sin antes tocar el precio
    2. el minimo (en compra )o el maximo (en venta) de 5 o 6 velas atras
    #221673 quote
    Antuan
    Participant
    Senior

    Vale ..en compra…profit está cuando cierre de vela por encima del valor 80 en stoch 14.2.1 …y su stop ..estaría situado, una vez hecha la entrada, en el MINIMO de las 5/6 velas últimas velas contando desde donde se produce la entrada..igual en venta..pero el valor del stoch sería 20 y stop en el MAXIMO de las 5/6 velas atrás contando desde que se produce la entrada.

    He aportado fotos para mayor claridad…si hace falta cuelgo la entrada exacta …GRACIAS SIEMPRE

    #221697 quote
    robertogozzi
    Moderator
    Master

    Ahi esta:

    ONCE LB = 5
    ONCE OB = 80
    ONCE OS = 100 - OB
    stoK = Stochastic[14,2](close)
    // LONG  entry & exit
    IF (stoK CROSSES OVER  OS) AND (summation[LB](stoK <= OS) = LB)[1] AND Not LongOnMarket  THEN
       BUY 1 CONTRACT AT MARKET
       SET STOP PRICE lowest[LB](low)  //SL
    ENDIF
    IF stoK crosses OVER OB AND LongOnMarket THEN
       SELL AT MARKET
    ENDIF
    // SHORT entry n& exit
    IF (stoK CROSSES UNDER OB) AND (summation[LB](stoK >= OB) = LB)[1] AND Not ShortOnMarket THEN
       SELLSHORT 1 CONTRACT AT MARKET
       SET STOP PRICE highest[LB](high)  //SL
    ENDIF
    IF stoK crosses UNDER OS AND ShortOnMarket THEN
       EXITSHORT AT MARKET
    ENDIF
    #221703 quote
    Antuan
    Participant
    Senior

    Lo voy a probar robertogozzi..siempre mil gracias

    #221815 quote
    Antuan
    Participant
    Senior
    Robertogozzi , aun le falta algo que definir….cuando el profit supera las  5 velas, no lo  detecta, si el objetivo llega antes de las 5 siguientes velas si salta el profit si no ..no salta. Si  se abre operacion y  el profit estaen la  2,3,4,5 vela sin problema..en el stop pasa exactamente lo mismo, si el stop pasa 5 velas no lo detecta y no salta stop…Esto pasa igual tanto en compra como en venta…Aclarar que el punto de entrada no es con el stoch 14.2 es con macd y rsi ..te lo muestro
    ATR=averagetruerange[30](close)*1.5
    miMACD=exponentialAverage[4](close)-exponentialAverage[12](close)
    signal=exponentialAverage[3](miMACD)
    count=0
    numerobarrasMACD=lookbars
    a=rsi [7](close)
    bajista= a<30.5
    alcista= a>69.9
    
    for i=0 to numerobarrasMACD do
    if bajista[i] then
    count=count+1
    break
    else
    count=0
    endif
    next
    c1=count
    c2=miMACD crosses over signal
    ONCE LB = 5
    ONCE OB = 80
    
    once OB2 = 20
    
    stoK = Stochastic[14,2](close)
    
    if time>085900 and time<=173000 then
    if c1 and c2 then
    
    buy 1 CONTRACT AT MARKET
    
    endif
    for i=0 to numerobarrasMACD do
    if  alcista [i] then
    count=count+1
    break
    else
    count=0
    endif
    next
    c3=count
    c4= miMACD crosses under signal
    if time>085900 and time<=173000 then
    if c3 and c4 then
    
    SELLSHORT 0 CONTRACT AT MARKET
    endif
    endif
    endif
    
    
    
    ONCE LB = 5
    ONCE OB = 80
    ONCE OS = 100 - OB
    stoK = Stochastic[14,2](close)
    // LONG  entry & exit
    IF c2 AND (summation[LB](stoK <= OS) = LB)[1] AND Not LongOnMarket  THEN
    BUY 0 CONTRACT AT MARKET
    SET STOP PRICE lowest[LB](low)  //SL
    ENDIF
    IF stoK crosses OVER OB AND LongOnMarket THEN
    SELL AT MARKET
    ENDIF
    // SHORT entry n& exit
    IF c4 AND (summation[LB](stoK >= OB) = LB)[1] AND Not ShortOnMarket THEN
    SELLSHORT 0 CONTRACT AT MARKET
    SET STOP PRICE highest[LB](high)  //SL
    ENDIF
    IF stoK crosses UNDER OS AND ShortOnMarket THEN
    EXITSHORT AT MARKET
    ENDIF
    
    NO-SALTA-PROFIT-4.jpg NO-SALTA-PROFIT-4.jpg NO-SALTA-STOP3.jpg NO-SALTA-STOP3.jpg
    #221818 quote
    Antuan
    Participant
    Senior
    Me he atrancado y no doy con la tecla Robertogozzi..por FAVOR
    #221845 quote
    robertogozzi
    Moderator
    Master
    ¿Qué llave? No entiendo lo que quieres hacer y no entiendo lo que debo hacer.
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

definir profit y stop


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
Antuan @osupero Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 09/26/2023
Status: Active
Attachments: 5 files
Logo Logo
Loading...