Problema con media exponencial

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

    Hola a todos.

    Estoy usando el siguiente código .

    xmf=MoneyFlowIndex[14]
    OB1=(BollingerUp[25](totalprice)+BollingerDown[25](totalprice))/2
    OB2=BollingerUp[25](totalprice)-BollingerDown[25](totalprice)
    bolosc=((totalprice-OB1)/OB2)*100
    xrsi=rsi[14](totalprice)
    Stoc=Stochastic[21,3](totalprice)
    marron=(xrsi+xmf+bolosc+(stoc/3))/2
    
    mymedia=ExponentialAverage[15](marron)

    Después de mucho indagar, he descubierto que la variable mymedia no se recibe bien informada, es decir viene como null o falso, ya que cuando pregunto por ella en un “IF not mymedia”, la condición se cumple. En cambio preguntar por mymedia>0 ó mymedia<0 o mymedia=0… nada se cumple.

    Lo curioso, es que esto solo pasa en un sistema o programa para hacer backtest. Es decir, si ese código lo pongo como un indicador, el sistema muestra el indicador correctamente, con la variable mymedia informada con los valores numéricos que correspondan. Aun más curioso es, que si en vez de la media exponencial, uso la normal, tal que así:

    mymedia=Average[15](marron)

     

    Pues funciona perfectamente y la variable queda informada correctamente.

     

    ¿alguien me puede ayudar?

    Gracias de antemano.

    #145688 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    Trate de no usar la media exponencial directamente, sino AVERAGE en forma exponencial:

    mymedia=Average[15,1](marron)
    #145690 quote
    AlturronAlturron
    Participant
    New

    Pues muchisimas gracias

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

Problema con media exponencial


ProScreener: Buscadores de Mercado y Rastreo

New Reply
Author
author-avatar
Alturron @alturron Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by AlturronAlturron
6 years ago.

Topic Details
Forum: ProScreener: Buscadores de Mercado y Rastreo
Language: Spanish
Started: 09/28/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...