backtest: ¿stop profit fijo con el valor del parabolic sar la vela de entrada?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #7219 quote
    ALGARALGAR
    Participant
    New

    Tengo esta programación, pero me falta ponerle mi stop de salida por beneficios, pero no consigo saber como hacerlo.

    Espero que alguien me pueda indicar como lo tengo que poner……..necesito saber como podría indicarle que cierre  la posición con beneficios, con el valor que tiene el PARABOLICO SAR , en la vela que da la señal de  entrada de cortos.

    parabolic = SAR[0.02,0.02,0.2]
    expmm55 = ExponentialAverage[55](close)
    ATR = AverageTrueRange[14](close)
    ENTRADACORTA =((ATR*1/2) + (close))
    PERDIDA =  (ATR*2)

    IF condición1 and condición2 and parabolic < (close) THEN

    SELLSHORT 1 SHARE AT ENTRADACORTA  LIMIT

    SET STOP PLOSS  PERDIDA

    ¿¿¿SET TARGET PPROFIT ??
    endif

    dudas_codigo.jpg dudas_codigo.jpg
    #7240 quote
    AdolfoAdolfo
    Participant
    Senior

    Hola, a ver si acierto…

    IF condición1 and condición2 and parabolic < (close) THEN 
    mySAR = SAR[0.02,0.02,0.2] // Aquí fijas el precio objetivo en el momento que se cumplen tus condiciones de entrada
    SELLSHORT 1 SHARE AT ENTRADACORTA  LIMIT  
    SET STOP PLOSS  PERDIDA
    ENDIF
    IF ShortOnMarket THEN
    EXITSHORT AT mySAR LIMIT
    ENDIF

    ¡Espero que te sirva!

    Nicolas and ALGAR thanked this post
    #7285 quote
    ALGARALGAR
    Participant
    New

    Muchas gracias.

    Lo he probado y es lo que necesitaba.

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

backtest: ¿stop profit fijo con el valor del parabolic sar la vela de entrada?


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
ALGAR @algar Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 05/17/2016
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...