[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Help with filling array


  • Date: Thu, 24 Dec 2009 09:23:19 +0800
  • From: Graham <kavemanperth@xxxxxxxxx>
  • Subject: Re: [amibroker] Re: Help with filling array

PureBytes Links

Trading Reference Links

You are only defining the values for bars between 5 and 50, not a full
array. ie slope[40] is the value for the 40th bar (per barindex()
count) of the history.
You need to explain what you are actually trying to achieve before any
help can be given

-- 
Cheers
Graham Kav
AFL Writing Service
http://www.aflwriting.com



2009/12/24 Marty J <prog200@xxxxxxxxx>:
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, Aron <aron.groups@xxx> wrote:
>>
>> |*for*(i=5;i<51;i++)
>> {
>> AvgSum = Sum(*C*,i)/i;
>> ry= Ref(AvgSum ,-1);
>> array = (AvgSum - ry)/*C* *100;
>> slope[i] = array[i];
>> }
>> |
>>
>>
>> On 12/23/2009 1:43 AM, Marty J wrote:
>> > I'm having trouble with the following code
>> > Like to fill the array.
>> >
>> > for(i=5;i<51;i++)
>> > {
>> > AvgSum = Sum(C,i)/i;
>> > ry= Ref(AvgSum ,-1);
>> > slope[i] = (AvgSum - ry)/C *100;
>> > }
>> >
>> > The following error occurs
>> > Error 8. Type mismatch, the value assigned to the array element has to be a number. You can not use array on the right-side of this assignment.
>> >
>> >
>> > Is there another way of doing this?
>> >
>> > Thnx
>> >
>> >
>> >
>> >
>> >
>> >
>> > ------------------------------------
>> >
>> > **** IMPORTANT PLEASE READ ****
>> > This group is for the discussion between users only.
>> > This is *NOT* technical support channel.
>> >
>> > TO GET TECHNICAL SUPPORT send an e-mail directly to
>> > SUPPORT {at} amibroker.com
>> >
>> > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
>> > http://www.amibroker.com/feedback/
>> > (submissions sent via other channels won't be considered)
>> >
>> > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>> > http://www.amibroker.com/devlog/
>> >
>> > Yahoo! Groups Links
>> >
>> >
>> >
>> >
>>
> Still not working correctly.
>
> for(i=45;i<51;i++)
> {
> AvgSum = Sum(C,i)/i;
> ry= Ref(AvgSum ,-1);
> array = (AvgSum - ry)/C *100;
> slope[i] = array[i];
> printf("array = %f\n" ,array  );
> printf("slope1[%g] = %f\n",i, slope[i] );
> }
>
> array = 0.543919      <==== this is what the value should be
> slope[45] = 0.073096  <==== This is wrong. Why?
> array = 0.562687
> slope[46] = 0.068811
> array = 0.441399
> slope[47] = 0.088211
> array = 0.372907
> slope1[48] = 0.094559
> array = 0.432736
> slope[49] = 0.096924
> array = 0.454843
> slope[50] = 0.094987
> array = 0.454843
>
>
> Thnx
>
>
>
> ------------------------------------
>
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> Yahoo! Groups Links
>
>
>
>


------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/