Al crear un proscreener no me devuelve el valor correcto

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #167539 quote
    colomvo
    Participant
    New

    Hola, intento crear un proscreener y no se que hago mal ya que al ejecutarlo no me devuelve el valor 1 nunca. Siempre me devuelve 2. Sin embargo, el indicador funciona correctamente y devuelve el 1 o el 2 cuando corresponde. Estoy desesperado ya que no consigo ejecutar un proscreener haciendo un CALL a un indicador. Gracias:

    EMM660 = ExponentialAverage[660](close)
    SMM20 = Average[15] (close)
    if high > pmax[1] then
    Pmax = high
    barmax = barindex
    endif
    if SMM20 crosses over EMM660 or SMM20 crosses under EMM660 then
    pmax = 0
    barmax = 0
    presenal = 0
    pmaxprev = 0
    endif
    
    indica = 0
    if EMM660[1] < EMM660 then // Es tendencia alcista
    if high[3] > SMM20 and high[2] > SMM20 and close < SMM20 and close[1] crosses under SMM20 then
    indica = 1
    presenal = 1
    pmaxprev = pmax
    
    endif
    else
    pmax = 0
    barmax = 0
    presenal = 0
    pmaxprev = 0
    endif
    
    if close > pmaxprev then
    presenal = 2
    endif
    
    return presenal
    #167540 quote
    robertogozzi
    Moderator
    Legend

    Siempre use el botón “Insert PRT Code” cuando incluya e inserte un código en sus mensajes para que sea más fácil de leer para otros.

    #167542 quote
    robertogozzi
    Moderator
    Legend

    Puedes probar esto, pero no estoy seguro de si funciona, en el indicador que publicaste hay algunas variables sin usar y no sé para qué sirven:

    EMM660 = ExponentialAverage[660](close)
    SMM20 = Average[15] (close)
    if high > pmax[1] then
    Pmax = high
    endif
    if SMM20 crosses over EMM660 or SMM20 crosses under EMM660 then
    pmax = 0
    presenal = 0
    pmaxprev = 0
    endif
    if EMM660[1] < EMM660 then // Es tendencia alcista
    if high[3] > SMM20 and high[2] > SMM20 and close < SMM20 and close[1] crosses under SMM20 then
    presenal = 1
    pmaxprev = pmax
    endif
    else
    pmax     = 0
    presenal = 0
    pmaxprev = 0
    endif
    if close > pmaxprev then
    presenal = 2
    endif
    SCREENER[presenal](presenal AS "1/2")
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

Al crear un proscreener no me devuelve el valor correcto


ProScreener: Buscadores de Mercado y Rastreo

New Reply
Author
author-avatar
colomvo @colomvo Participant
Summary

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

Topic Details
Forum: ProScreener: Buscadores de Mercado y Rastreo
Language: Spanish
Started: 04/19/2021
Status: Active
Attachments: No files
Logo Logo
Loading...