creacion de backtesting

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

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

    #218099 quote
    DECO2021DECO2021
    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
    robertogozzirobertogozzi
    Moderator
    Legend

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

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 robertogozzirobertogozzi
3 years, 1 month ago.

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