Stop Loss debajo de la MM50 al momento de la compra

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #175740 quote
    DALUPEZDALUPEZ
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    GraHalGraHal
    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.
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

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 GraHalGraHal
5 years, 1 month ago.

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