NexusFi: Find Your Edge


Home Menu

 





Xaverage


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one sam028 with 2 posts (2 thanks)
    2. looks_two banana10 with 2 posts (0 thanks)
    3. looks_3 ABCTG with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 2,870 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
banana10
New york NY USA
 
Posts: 2 since Sep 2016
Thanks Given: 0
Thanks Received: 0

Hello,

I am trying to find out how to find a similar function "Xaverage" in python.

This is what I have in easylanguage: test = XAverage( Close, Length ) and I am trying to change it into python.

Thank you very much.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Airspace Collapses 18 Points to 15.5% While Hormuz …
Prediction Markets & Event Contracts
El Clasico Draws $9.2M in Prediction Market Action -- Bi …
Prediction Markets & Event Contracts
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Hungary Called for Magyar at 97pct, Ending 16-Year Orban …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
197 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
BERN ALGOS algo trading journal
8 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,757 since Jun 2009
Thanks Given: 3,828
Thanks Received: 4,640



banana10 View Post
Hello,

I am trying to find out how to find a similar function "Xaverage" in python.

This is what I have in easylanguage: test = XAverage( Close, Length ) and I am trying to change it into python.

Thank you very much.

In pure Python, with NumPy, with another library?


Success requires no deodorant! (Sun Tzu)
Reply With Quote
  #4 (permalink)
banana10
New york NY USA
 
Posts: 2 since Sep 2016
Thanks Given: 0
Thanks Received: 0


sam028 View Post
In pure Python, with NumPy, with another library?

I have installed both libraries:
import matplotlib.pyplot as plt
# import numpy as np

either ones work for me. Thanks a lot.


Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

banana10

XAverage is simply an exponential average. I am pretty sure that is either available already or you can easily program it or find code via google.

Regards,

ABCTG


Follow me on X Reply With Quote
  #6 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,757 since Jun 2009
Thanks Given: 3,828
Thanks Received: 4,640


banana10 View Post
I have installed both libraries:
import matplotlib.pyplot as plt
# import numpy as np

either ones work for me. Thanks a lot.

You can find good examples here.

An easy to understand one is:
 
Code
                            
def moving_average(xntype):

    
np.asarray(x)
    if 
type=='simple':
        
weights np.ones(n)
    else:
        
weights np.exp(np.linspace(-1.0.n))

    
weights /= weights.sum()

    
=  np.convolve(xweightsmode='full')[:len(x)]
    
a[:n] = a[n]
    return 


Success requires no deodorant! (Sun Tzu)
Reply With Quote
Thanked by:




Last Updated on September 14, 2016


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts