Isn't XAverage just an EMA? It's built-in to Sierra as Exponential Moving Average under Moving Averages.
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.
The entire code i posted is the XAverage function itself.
I have no idea if its an Exponential Moving Average or not.
If the sierra Exponential Moving Average returns the exact same value with the same given input then i guess that would work.
However the the function appears to call itself at least twice with its previous value XAverage 
and I have no idea how to do that.
The SC sc.ExponentialMovAvg() takes in arrays and spits out arrays.
The Tradestation XAverage function does not appear to deal with arrays.
As my calling code in my TS indicator is:
Var1 = (HIGH - LOW) ; //one single value not array
Var2 = HIGH - Var1 ; // one single value not array
Var4 = XAverage (Var2, 6) ; // XAverage returns one single value not an array
I`m guessing that converting the Tradestation function to a SC function must be a very difficult task, since no one has tried.
If someone could take 60 seconds to post a custom created function as a sample template and tell me in where or what file i need to place it in to be able to call it from my indicator code.
I will tackle the difficult task of converting the XAverage to SC code.
In Tradestation if I want a variable.
Variables: Var4(1) ;
Var4 = 1;
If I want to create an Array in Tradestation.
Array: int Var4;
Var4 = 1
Var4 = 2
If tradestation is converting a single created variable into a one dimensional array behind the scenes then i didn't know about that.
I tried to use Var4 as an input to the sc.ExponentialMovAvg and it chocked since Var4 wasn't a manual created array.
Thanks for the code you posted, but it isn't in in the form of a callable function since the XAverage function even calls itself several times.
The code i previous posted is the entire XAverage function itself and i need the converted code to be in the form of a function.
Since I will need to call the converted function several times in my current indicator code and future indicators I need to convert to SC