ordenes acumulación

Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #150509 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Ahora entiendo y solucioné el problema, pero en la línea 28 no tienes que poner 5, de lo contrario se detiene de inmediato, intenta poner 99 y verás que llega al máximo:

    // Definición de los parámetros del código
    DEFPARAM CumulateOrders = True // Acumulación de posiciones desactivada
    ONCE MaxPositions = 5
    IF Not OnMarket THEN
    Cuenta = 0
    ENDIF
    // Condiciones de entrada de posiciones cortas
    indicator2, indicator1 = CALL "PRC_Top Bottom Indicator"[14, 14]
    c1 = (indicator1 > indicator2)
    indicator3 = CALL "butter prorealcode"
    indicator4 = CALL "butter prorealcode"
    c2 = (indicator3 < indicator4[1])
    indicator5 = CALL "butter prorealcode"
    indicator6 = ExponentialAverage[14](close)
    c3 = (indicator5 < indicator6)
    IF c1 AND c2 AND c3 AND Cuenta < MaxPositions THEN
    SELLSHORT (MaxPositions - Cuenta) SHARES AT MARKET
    Cuenta = Cuenta + 1
    ENDIF
     
    // Condiciones de salida de posiciones cortas
    indicator7, indicator8 = CALL "PRC_Top Bottom Indicator"[14,14]
    c4 = (indicator7 > indicator8)
     
    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF
    IF ShortOnMarket AND CountOfShortShares >= 99 THEN
    EXITSHORT AT MARKET
    ENDIF
    //
    //graph Cuenta
    //graph abs(CountOfPosition)
    //graph OnMarket
    //graph c4
    #150510 quote
    galibiergalibier
    Participant
    Average

    Muchísimas gracias, esto es lo que buscaba!!

    Muy agradecido sr.Roberto!!

    saludos

Viewing 2 posts - 16 through 17 (of 17 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

ordenes acumulación


ProOrder: Trading Automático y Backtesting

New Reply
Author
author-avatar
galibier @galibier Participant
Summary

This topic contains 16 replies,
has 2 voices, and was last updated by galibiergalibier
5 years, 10 months ago.

Topic Details
Forum: ProOrder: Trading Automático y Backtesting
Language: Spanish
Started: 11/13/2020
Status: Active
Attachments: 3 files
ProRealCode ProRealCode
Loading...