Stop Loss debajo de la MM50 al momento de la compra

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

    Una consulta. En un Backtest ¿Para poner un stop loss debajo de la MM50 al momento de la compra como sería? Desde ya muchas gracias

    1-Que se mantenga fijo debajo del 1% media movil de 50

    2-Que se se vaya actualizando debajo del 1% media movil de 50

    #175764 quote
    robertogozzi
    Moderator
    Master

    Este es el código para tener el SL inicial por debajo del SMA50, que permanece fijo:

    Sma50 = average[50,0](close)
    MyLongConditions = close CROSSES OVER average[10,0](close)
    IF MyLongConditions AND Not OnMarket THEN
       BUY 1 Contract at Market
       Sl = close - Sma50
       Tp = Sl * 2
       SET TARGET PROFIT Tp
       SET STOP   LOSS   Sl
    ENDIF

    Este es el código para tener el SL inicial un 1% por debajo del SMA50, que permanece fijo:

    Sma50 = average[50,0](close)
    MyLongConditions = close CROSSES OVER average[10,0](close)
    IF MyLongConditions AND Not OnMarket THEN
       BUY 1 Contract at Market
       Sl = close - (Sma50 * 0.99)
       Tp = Sl * 2
       SET TARGET PROFIT Tp
       SET STOP   LOSS   Sl
    ENDIF

    Este es el código para tener el SL inicial un 1% por debajo del SMA50, que se actualiza siguiendo el promedio:

    Sma50 = average[50,0](close)
    IF LongOnMarket THEN
       Sl = TradePrice - (Sma50 * 0.99)
       SET STOP   LOSS   Sl
    ENDIF
    MyLongConditions = close CROSSES OVER average[10,0](close)
    IF MyLongConditions AND Not OnMarket THEN
       BUY 1 Contract at Market
       Sl = close - (Sma50 * 0.99)
       Tp = Sl * 2
       SET TARGET PROFIT Tp
       SET STOP   LOSS   Sl
    ENDIF
    #175775 quote
    GraHal
    Participant
    Master

    Enlace a arriba agregado como Log 302 aquí …

    Biblioteca de enlaces de fragmentos

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

Stop Loss debajo de la MM50 al momento de la compra


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
DALUPEZ @dalupez Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by GraHal
4 years, 6 months ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 08/19/2021
Status: Active
Attachments: No files
Logo Logo
Loading...