What method are you using to add values to the array on each bar? The default seems to add to the end of the array, not the beginning.
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 function that got me started on this, was actually ill written, to some extent, and I could have managed without the array (in that case I put values into it in the wrong order).
So when I was testing the XAverage_a I just made a copy of the price numeric series copying the data into the array for test purposes; and hence getting the 0..N order with 0 being the last. I can see that the normal use of arrays would be to append values at the end of the array at each bar and that would require your function to calc EMA over it.
The following user says Thank You to ValutaTrader for this post:
I've been looking at how to pass the values of an array out of a function in Multicharts so that it can be used in an indicator. I have read this in the Multicharts Programming Guide;
Usage Example (function named "MaxValArray"):
Result = MyNumericArray; //Reset variable each time.
For Value1 = 1 To M begin
if MyNumericArray[Value1] > Result Then Result = MyNumericArray[Value1];
MaxValArray = Result;
However it seems that we are just passing the value of M to this function. Will the Array MyNumericArray now have values that can be used by the indicator when it calls MaxValArray? I can't seem to get this working and getting
------ Compiled with error(s): ------
Invalid array dimension value.
line -1, column -1
Does anyone have an example of a function that can be called by an indicator where the value of an array can be passed in/out of this function?