Sistema Optimización variable n periodos atrás

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #192465 quote
    lokbuscaslokbuscas
    Participant
    Average

    Hola,

    me gustaría saber como puedo programar algo así para un sistema.

    Compra cuando RSI>30 pero con la condición de que haya permanecido RSI por debajo de 30 “n” periodos antes.

    Y optimizar “n” para probar diferentes período y resultados

    Gracias

    #192541 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ahi esta:

    DEFPARAM CumulateOrders = False
    ONCE LB      = 5           //5  LookBack periods < 30
    ONCE RsiP    = 14          //14 periods
    ONCE MyLevel = 30          //30
    MyRSI  = Rsi[RsiP](close)
    CondL1 = MyRSI CROSSES OVER MyLevel
    CondL2 = (summation[LB](MyRsi[1] < 30) = LB)
    CondL  = CondL1 AND CondL2 AND Not OnMarket
    IF CondL THEN
    BUY 1 Contract AT Market
    ENDIF
    SET STOP   pLOSS   150
    SET TARGET pPROFIT 600
    #192547 quote
    lokbuscaslokbuscas
    Participant
    Average

    Muchas gracias Roberto

    Si quisiera poner las condiciones de compra en semanal y unas condiciones de venta en mensual

    por ejemplo en en caso de que el precio durante el día en mensual estuviera por debajo de una media exponencial de 2 periodos sería así??

    Timeframe (monthly)

    Ema2 = exponentialaverage[2](close)

    CondL3 = tradeprice < ema2

    If CondL3 then

    sell at Market

    Endif

    Esto es correcto??

    #192550 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    No, la condición debe estar en el marco de tiempo diario:

    Timeframe (monthly)
    Ema2 = exponentialaverage[2](close)
    Timeframe(Daily)
    CondL3 = tradeprice < ema2
    If CondL3 then
       sell at Market
    Endif
    #192551 quote
    lokbuscaslokbuscas
    Participant
    Average

    Ok

    Muchas gracias Roberto

    Tenía un error de concepto importante

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

Sistema Optimización variable n periodos atrás


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
lokbuscas @lokbuscas Participant
Summary

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

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 04/30/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...