Formaciones en Expansión

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #244694 quote
    Maricarmen
    Participant
    Junior

    Hola:

    Se podría hacer del Screener del indicador que detallo a continuación.

    Gracias.

    https://www.prorealcode.com/topic/formaciones-en-expansion/

    #244732 quote
    Iván González
    Moderator
    Master

    Sería así:

    period=9
    leftbars=period
    rightbars=period//max(1,floor(period/2))
    src1 = low
    src2 = high
    //---Pivots Low
    if src1 > src1[rightbars] and lowest[rightbars](src1) > src1[rightbars] and src1[rightbars] < lowest[leftbars](src1)[rightbars+1] then
    
    if $Type[z]=-1 and src1[rightbars]<$Py[z] then
    $Py[z]=src1[rightbars]
    $Px[z]=barindex[rightbars]
    else
    $Py[z+1]=src1[rightbars]
    $Px[z+1]=barindex[rightbars]
    $Type[z+1]=-1
    z=z+1
    endif
    //y=(x-x1)*slope+y1
    if $Py[z]<$Py[max(0,z-2)] then
    $slope[z]=($Py[z]-$Py[max(0,z-2)])/($Px[z]-$Px[max(0,z-2)])
    endif
    
    endif
    //---Pivots High
    if src2 < src2[rightbars] and highest[rightbars](src2)<src2[rightbars] and src2[rightbars]>highest[leftbars](src2)[rightbars+1] then
    if $Type[z]=1 and src2[rightbars]>$Py[z] then
    $Py[z]=src2[rightbars]
    $Px[z]=barindex[rightbars]
    else
    $Py[z+1]=src2[rightbars]
    $Px[z+1]=barindex[rightbars]
    $Type[z+1]=1
    z=z+1
    endif
    //y=(x-x1)*slope+y1
    if $Py[z]>$Py[max(0,z-2)] then
    $slope[z]=($Py[z]-$Py[max(0,z-2)])/($Px[z]-$Px[max(0,z-2)])
    endif
    endif
    
    //Up Trendline
    if islastbarupdate then
    crossedline=0
    setupup=0
    for i=z downto 4 do
    if $Type[i-1]=1 and $Type[i-3]=1 then
    if $Py[i-1]>$Py[i-3] then
    x1=$Px[i-3]
    y1=$Py[i-3]
    x2=$Px[i-1]
    y2=$Py[i-1]
    
    for j=$Px[i-1]+1 to barindex do
    x3=j
    y3=y1+(x3-x1)*$slope[i-1]
    if close[barindex-j]>y3 then
    crossedline=1
    break
    endif
    next
    x = barindex
    y = y1+(x-x1)*(y2-y1)/(x2-x1)
    if crossedline=0 and high>y and low<y then
    setupup=1
    endif
    endif
    endif
    next
    endif
    //Down Trendline
    if islastbarupdate then
    crossedline=0
    setupdn=0
    for i=z downto 4 do
    if $Type[i-1]=-1 and $Type[i-3]=-1 then
    if $Py[i-1]<$Py[i-3] then
    x1=$Px[i-3]
    y1=$Py[i-3]
    x2=$Px[i-1]
    y2=$Py[i-1]
    
    for j=$Px[i-1]+1 to barindex do
    x3=j
    y3=y1+(x3-x1)*$slope[i-1]
    if close[barindex-j]>y3 then
    crossedline=1
    break
    endif
    next
    x = barindex
    y = y1+(x-x1)*(y2-y1)/(x2-x1)
    if crossedline=0 and high>y and low<y then
    setupdn=-1
    endif
    endif
    endif
    next
    endif
    screener[setupup or setupdn]

    Te saldrán muy pocos valores porque le estás pidiendo valores que van contrapendiente.

    robertogozzi and Maricarmen thanked this post
    #244736 quote
    Maricarmen
    Participant
    Junior

    Gracias Ivan, veo que tienes razón pues  cargue el Screener y no me devolvió nada. Seguiré probando para ver que es lo que  hace, pues en los gráficos compruebo que si marca los segmentos de unión de  2 o más mínimos.

    Entendiendo que si el gráfico marca el segmento,  en algún momento el Screener nos tendrá que devolver algo.

     

    .

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Formaciones en Expansión


ProScreener: Buscadores de Mercado y Rastreo

New Reply
Author
author-avatar
Maricarmen @maricarmen Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Maricarmen
12 months ago.

Topic Details
Forum: ProScreener: Buscadores de Mercado y Rastreo
Language: Spanish
Started: 03/05/2025
Status: Active
Attachments: No files
Logo Logo
Loading...