NexusFi: Find Your Edge


Home Menu

 





Xaverage


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one banana10 with 2 posts (0 thanks)
    2. looks_two sam028 with 2 posts (2 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 ABCTG with 1 posts (0 thanks)
    1. trending_up 2,400 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?
Cycle Through Ninjatrader Open Windows
NinjaTrader
Server CPUs and Multicharts 14 or 15 limits
MultiCharts
How to distinguish between trending and mean reversion
The Elite Circle
What a Cool Draw/Markup Tool!
Traders Hideout
IB Gateway / IBKR (semi-) daily restart / login
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Vinny E-Mini & Algobox Review TRADE ROOM
8 thanks
Futures spread trading grains education sources?
6 thanks
Just another trading journal: PA, Wyckoff & Trends
4 thanks
Wheres the videos?
3 thanks
Blue wave trading review
2 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,630



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 Twitter 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,441 since Apr 2013
Thanks Given: 491
Thanks Received: 1,634

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 Twitter Reply With Quote
  #6 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,630


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 Twitter Reply With Quote
Thanked by:




Last Updated on September 14, 2016


© 2024 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 - Privacy Policy - Sitemap - Downloads - Top
no new posts