Download MetaTrader 5

Average data recorded in Array as time series

To add comments, please log in or register
Share the links to products and make your profit
johnireton
11
johnireton 2013.09.11 17:54 

Can anyone help?


I have data which is an out put from an indicator i have averaged this data within an EA now i want to use the average in history based on time series. I have tried an array but when i check with ArrayIsSeries i get the message it is not a time series. Below is the code i have been using.

ArrayResize(SP9,200,0);

ArrayInitialize(SP9,EMPTY_VALUE);

for(i=90;i<200;i++) printf("array[%d] = %G",i,av200[i]);

Print("Values of 10 last elements after ArrayResize(array,105)");

for(i=95;i<105;i++) printf("array[%d] = %G",i,av200[i]);

ArraySetAsSeries(SP9,true);

if(ArrayIsSeries(SP9))
   Print("SP9[] is timeseries");
else
   Print("SP9[] is not timeseries!!!");
//--- return value of prev_calculated for next call

// return(rates_total);


John

Alain Verleyen
Moderator
30704
Alain Verleyen 2013.09.11 18:16  
johnireton:
...
Please edit your post and use the SRC button when you post code.
Alain Verleyen
Moderator
30704
Alain Verleyen 2013.09.11 18:44  

Seems you don't understand what I asked you, so I do it for you (edit your first post).

You probably have to use ArrayGetAsSeries(). See this topic about about ArrayIsSeries.

johnireton
11
johnireton 2013.09.11 18:57  
angevoyageur:

Seems you don't understand what I asked you, so I do it for you (edit your first post).

You probably have to use ArrayGetAsSeries(). See this topic about about ArrayIsSeries.

Sorry for misunderstanding, already tried ArrayGetAsSeries() this did not work either still gives message that array is not series!


Any ideas?

Alain Verleyen
Moderator
30704
Alain Verleyen 2013.09.11 19:05  
johnireton:

Sorry for misunderstanding, already tried ArrayGetAsSeries() this did not work either still gives message that array is not series!


Any ideas?

Can you provide code that compiles where you are using ArrayGetAsSeries() ?
johnireton
11
johnireton 2013.09.12 17:30  
angevoyageur:
Can y
angevoyageur:
Can you provide code that compiles where you are using ArrayGetAsSeries() ?
Is this bit of code what you mean?
 SP9[0]=NormalizeDouble((Nom1+Nom2+Nom3+Nom4+Nom5+Nom6+Nom7+Nom8+Nom9+Nom10+Nom11+Nom12+Nom13+Nom14+Nom15+Nom16+Nom17+Nom18+Nom19+Nom20+Nom21+Nom22+Nom23+
                              Nom24+Nom25+Nom26+Nom27+Nom28+Nom29+Nom30+Nom31+Nom32+Nom33+Nom34+Nom35+Nom36+Nom37+Nom38+Nom39+Nom40+Nom41+Nom42+Nom43+Nom44+
                              Nom45+Nom46+Nom47+Nom48+Nom49+Nom50+Nom51+Nom52+Nom53+Nom54+Nom55+Nom56+Nom57+Nom58+Nom59+Nom60+Nom61+Nom62+Nom63+Nom64+
                              Nom65+Nom66+Nom67+Nom68+Nom69+Nom70+Nom71+Nom72+Nom73+Nom74+Nom75+Nom76+Nom77+Nom78+Nom79+Nom80+Nom81+Nom82+Nom83+Nom84+Nom85+
                              Nom86+Nom87+Nom88+Nom89+Nom90+Nom91+Nom92+Nom93+Nom94+Nom95+Nom96+Nom97+Nom98+Nom99+Nom100+Nom101+Nom102+Nom103+Nom104+   Nom105+
                              Nom106+Nom107+Nom108+Nom109+Nom110+Nom111+Nom112+Nom113+Nom114+Nom115+Nom116+Nom117+Nom118+Nom119+Nom120+Nom121+Nom122+Nom123+
                              Nom124+Nom125+Nom126+Nom127+Nom128+Nom129+Nom130+Nom131+Nom132+Nom133+Nom134+Nom135+Nom136+Nom137+Nom138+Nom139+Nom140+Nom141+
                              Nom142+Nom143+Nom144+Nom145+Nom146+Nom147+Nom148+Nom149+Nom150+Nom151+Nom152+Nom153+Nom154+Nom155+Nom156+Nom157+Nom158+Nom159+Nom160+
                              Nom161+Nom162+Nom163+Nom164+Nom165+Nom166+Nom167+Nom168+Nom169+Nom170+Nom171+Nom172+Nom173+Nom174+Nom175+Nom176+Nom177+Nom178+
                              Nom179+Nom180+Nom181+Nom182+Nom183+Nom184+Nom185+Nom186+Nom187+Nom188+Nom189+Nom190+Nom191+Nom192+Nom193+Nom194+Nom195+Nom196+
                              Nom197+Nom198+Nom199+Nom200)/200,5);
To add comments, please log in or register