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,256 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Xaverage

  #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?
ZombieSqueeze
Platforms and Indicators
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629



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,434 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

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,629


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 - Downloads - Top
no new posts