error codigo "positive integer field is expected with barindex"

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #100329 quote
    MazarronMazarron
    Participant
    Average
    Hola a todos tengo un problema con un codigo , en v10 funciona en v11 no funciona , mensaje error:(a positive integer field is expected with barindex) “enter/spacebear”key EL CODIGO :   period=30 vmstop=1 hismax=max(hismax,high) maxim=highest[barindex](low) //indicador maximos minimos 52 periodos maxma=highest[52](close) minma=lowest[52](close) //media ponderada y % stoploss mp=weightedaverage [period](close) vm=mp-((mp*((vmstop+100)/100))-mp)-0.00 //puntos atr=averagetruerange[20] topy=high topx=barindex topy2=vm boty=low botx=barindex if close>maxim[1]then drawtext(“☺”,botx,boty+atr*1.66,dialog,standard,14)coloured(0,100,255,180) endif //semaforo alcista alfayate mm30=weightedaverage[30](close) cap=volume*close maxi=highest[52](close) volmax=highest[52](cap) vol=((cap*100/volmax)*4/5) volpmed=exponentialaverage[52](vol) mycpm=(vol-volpmed) cpm5=(mycpm+mycpm[1]+mycpm[2]+mycpm[3]+mycpm[4])/5 cpm20=(mycpm+mycpm[1]+mycpm[2]+mycpm[3]+mycpm[4]+mycpm[5]+mycpm[6]+mycpm[7]+mycpm[8]+mycpm[9]+mycpm[10]+mycpm[11]+mycpm[12]+mycpm[13]+mycpm[14]+mycpm[15]+mycpm[16]+mycpm[17]+mycpm[18]+mycpm[19])/20 distanciamax=abs((close[0]-maxi)/close*100) riesgostop=abs((close-mm30)/close*100) //verificacion y representacion de condiciones //verifica estado si comprable “memoria” 52s if comprado=0and(distanciamax<2and riesgostop<9and riesgostop>3and cap>1000000and cpm5>0and cpm20>-15and fr>=0.1)then compra=1 comprado=1 venta=0 drawtext(“↑”,topx,topy+atr*0.66,dialog,standard,14)coloured(0,100,255,220) drawtext(“———————-“,topx,topy2+atr*0.00,dialog,standard,11)coloured(255,0,100,180) else compra=0 endif if comprado=1and(riesgostop>=30or cpm20<=-15or fr<=-0.9)then venta=1 compra=0 comprado=0 drawtext(“↓”,botx,boty-atr+0.66,dialog,standard,14)coloured(255,0,100,180) else venta=0 endif //indicador rscmansfield2 ignored, fr=call “rscmansfield2″ return mp as”media ponderada”,vm coloured(255,153,51)as “media ponderada % stoploss”, maxma coloured(0,125,255)as “maximos anuales”,minma coloured(255,125,125)as “minimos anuales”, compra coloured(0,153,0)as “compra”,venta coloured(255,0,0)as “venta”, fr as “mansfield”
    #100331 quote
    Juan SalasJuan Salas
    Participant
    Master
    Macaroon, Por favor utiliza “Insert PRT Code” (arriba, a la derecha) para que podamos leer el código correctamente. Gracias
    #100357 quote
    MazarronMazarron
    Participant
    Average
    period=30
    vmstop=1
    hismax=max(hismax,high)
    maxim=highest[barindex](low)
    //indicador maximos minimos 52 periodos
    maxma=highest[52](close)
    minma=lowest[52](close)
    //media ponderada y % stoploss
    mp=weightedaverage [period](close)
    vm=mp-((mp*((vmstop+100)/100))-mp)-0.00
    //puntos
    atr=averagetruerange[20]
    topy=high
    topx=barindex
    topy2=vm
    boty=low
    botx=barindex
    if close>maxim[1]then
    drawtext(“☺”,botx,boty+atr*1.66,dialog,standard,14)coloured(0,100,255,180)
    endif
    //semaforo alcista alfayate
    mm30=weightedaverage[30](close)
    cap=volume*close
    maxi=highest[52](close)
    volmax=highest[52](cap)
    vol=((cap*100/volmax)*4/5)
    volpmed=exponentialaverage[52](vol)
    mycpm=(vol-volpmed)
    cpm5=(mycpm+mycpm[1]+mycpm[2]+mycpm[3]+mycpm[4])/5
    cpm20=(mycpm+mycpm[1]+mycpm[2]+mycpm[3]+mycpm[4]+mycpm[5]+mycpm[6]+mycpm[7]+mycpm[8]+mycpm[9]+mycpm[10]+mycpm[11]+mycpm[12]+mycpm[13]+mycpm[14]+mycpm[15]+mycpm[16]+mycpm[17]+mycpm[18]+mycpm[19])/20
    distanciamax=abs((close[0]-maxi)/close*100)
    riesgostop=abs((close-mm30)/close*100)
    //verificacion y representacion de condiciones //verifica estado si comprable “memoria” 52s
    if comprado=0and(distanciamax<2and riesgostop<9and riesgostop>3and cap>1000000and cpm5>0and cpm20>-15and fr>=0.1)then
    compra=1
    comprado=1
    venta=0
    drawtext(“↑”,topx,topy+atr*0.66,dialog,standard,14)coloured(0,100,255,220)
    drawtext(“———————-“,topx,topy2+atr*0.00,dialog,standard,11)coloured(255,0,100,180)
    else
    compra=0
    endif
    if comprado=1and(riesgostop>=30or cpm20<=-15or fr<=-0.9)then
    venta=1
    compra=0
    comprado=0
    drawtext(“↓”,botx,boty-atr+0.66,dialog,standard,14)coloured(255,0,100,180)
    else
    venta=0
    endif
    //indicador rscmansfield2
    ignored, fr=call “rscmansfield2″
    
    return mp as”media ponderada”,vm coloured(255,153,51)as “media ponderada % stoploss”, maxma coloured(0,125,255)as “maximos anuales”,minma coloured(255,125,125)as “minimos anuales”, compra coloured(0,153,0)as “compra”,venta coloured(255,0,0)as “venta”, fr as “mansfield”
    #100399 quote
    NicolasNicolas
    Keymaster
    Legend
    No obtuve ningún error por mi parte, pero te sugiero que cambies la línea 3 con este código:
    maxim=highest[max(1,barindex)](low)
    Evitará que la instrucción más alta use un valor igual a 0.
    #109364 quote
    MazarronMazarron
    Participant
    Average
    buenas por fin pude probar el indicador, estado con otros trabajos sin tiempo para la inversion , a mi me daba fallo y me sigue dando fallo , con tu arreglo , me funciona pero me pinta muchas caras sonrientes …vaya …no se como arreglar
    #109385 quote
    MazarronMazarron
    Participant
    Average

    Buenos días Nicolás y familia , le pasado el código a un amigo y desde anoche y esta mañana imposible arreglar le da fallo de null

    IMG_20191005_220840_032.jpg IMG_20191005_220840_032.jpg
    #109387 quote
    MazarronMazarron
    Participant
    Average
    Y este fallo? A qué se debe a mi mi me sale y al amigo si
    IMG_20191006_103706_307.jpg IMG_20191006_103706_307.jpg IMG_20191006_103717_681.jpg IMG_20191006_103717_681.jpg
    #109475 quote
    NicolasNicolas
    Keymaster
    Legend
    ¿Estás tratando de poner un código indicador en la herramienta de filtro? Es por eso que no logra que funcione … no tiene que lidiar con un problema con la versión 11, en absoluto. Por favor, la próxima vez intenta hacer un título más explícito que simplemente: "ayúdame, nicolas", ¡porque no me motiva a responder rápidamente! 🙂
    #109484 quote
    MazarronMazarron
    Participant
    Average
    Gracias Nicolás , para próximas consultas intentaré hacer mejor , somos muy torpes para programar.
    #109505 quote
    MazarronMazarron
    Participant
    Average
    Gracias Nicolás mi amigo pensó que era screener estábamos locos jiji a mi mi funciona y a él no ya solucionado
Viewing 10 posts - 1 through 10 (of 10 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

error codigo "positive integer field is expected with barindex"


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
Mazarron @mazarron Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by MazarronMazarron
6 years, 11 months ago.

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 06/10/2019
Status: Active
Attachments: 3 files
ProRealCode ProRealCode
Loading...