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,846 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?
TradingView Opens Volume Footprint Data to Pine Script - …
TradingView
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
April Jobs Beat Flips Fed Hike Odds Past 52% for First T …
Traders Hideout
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
Ceasefire in Name Only: Three Numbers That Define the Ir …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
20 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
5 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632



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)
Follow me on X 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,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

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,756 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,632


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)
Follow me on X 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