Ayuda indicadores propios que no funcionan.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #167294 quote
    nautilus23
    Participant
    Average

    He preparado cuatro indicadores propios modificando un código que he visto por aquí y consigo que uno funcione bien pero los demás me dan como resultado 0 y no entiendo dónde está el error. La diferencia entre el 1º (el que funciona) y los demás es que he sustituido highest[10](close) por : highest[10](volume), highestPrice = highest[10](range), highestPrice = highest[10](range) y highestPrice = highest[10](ROC[1](close))

    ¿Alguien me puede ayudar?

    Muchas gracias.

     

    //1ºFUNCIONA
    highestPrice = highest[10](close)   
    highBar      = 0
    for i = 1 to 10                  
    if close[i] = highestPrice then
    highBar = i                      
    endif
    next
    PriceRange = range[highBar]      
    return highBar as "highbar10C"
    
    
    // 2º INDICADOR NO FUNCIONA
    highestPrice = highest[10](volume)
    highBar      = 0
    for i = 1 to 10
    if close[i] = highestPrice then
    highBar = i
    endif
    next
    PriceRange = range[highBar]
    return highBar as "highbar10volume"
    
    
    // 3º INDICADOR NO FUNCIONA
    highestPrice = highest[10](range)
    highBar      = 0
    for i = 1 to 10
    if close[i] = highestPrice then
    highBar = i
    endif
    next
    PriceRange = range[highBar]
    return highBar as "highbar10RANGE"
    
    // 4º INDICADOR NO FUNCIONA
    highestPrice = highest[10](ROC[1](close))
    highBar      = 0
    for i = 1 to 10
    if close[i] = highestPrice then
    highBar = i
    endif
    next
    return highBar as "highba10ROC1"
    
    
    #167295 quote
    robertogozzi
    Moderator
    Master

    Porque en la línea 5, con IF, debe utilizar el mismo tipo de datos que se utilizó en la línea 2 con HIGHEST.

    CLOSE con CLOSE, VOLUME con VOLUME, RANGE con RANGE y ROC [1] (close) con ROC [1] (close).

    nautilus23 thanked this post
    #167299 quote
    nautilus23
    Participant
    Average

    Muchas gracias, funciona perfectamente.

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

Ayuda indicadores propios que no funcionan.


ProBuilder: Indicadores y Herramientas

New Reply
Author
author-avatar
nautilus23 @nautilus23 Participant
Summary

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

Topic Details
Forum: ProBuilder: Indicadores y Herramientas
Language: Spanish
Started: 04/16/2021
Status: Active
Attachments: No files
Logo Logo
Loading...