creacion de backtesting

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #218075 quote
    DECO2021
    Participant
    New

    Hola.

    Alguien puede indicarme el código para este backtesting sencillo:

    Comprar el activo cuando caiga un 50% y venderlo cuando suba una 100% con un 2% del riesgo de cartera.

    Gracias.

    #218081 quote
    robertogozzi
    Moderator
    Master

    ¿50% menos de qué?
    ¿Ayer, hace una semana, hace un año o hace N velas?

    #218099 quote
    DECO2021
    Participant
    New

    Perdón.  Que caiga un 50 desde máximos históricos y que suba un 100 desde mínimos históricos.

    Gracias.

    #218135 quote
    robertogozzi
    Moderator
    Master

    Prueba este:

    DEFPARAM CumulateOrders = false
    //
    Timeframe(Yearly,default)
    maximo = highest[30](high)
    minimo = lowest[30](low)
    //
    Timeframe(default)
    IF close < (maximo / 2) and Not LongOnMarket then
       BUY  at Market
    ENDIF
    IF LongOnMarket AND (close > minimo * 2) then
       SELL at Market
    ENDIF
    //graphonprice maximo coloured("Green")
    //graphonprice minimo coloured("Red")
    DECO2021 thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

creacion de backtesting


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
DECO2021 @deco2021 Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 07/24/2023
Status: Active
Attachments: No files
Logo Logo
Loading...