getting compleet dataset from multiple timeframes in oncalculate()

Back to topics list To post a new topic, please log in or register
avatar
9
bertje 2016.04.09 15:25
 

Hi,

In the onCalculate() I have the compleet data set from the current chart with:

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])

 and

   ArraySetAsSeries(ExtLowHighBuffer,false);
   ArraySetAsSeries(ExtHighLowBuffer,false);
   ArraySetAsSeries(ExtOpenBuffer,false);
   ArraySetAsSeries(ExtCloseBuffer,false);
   ArraySetAsSeries(BuyBuffer,false);
   ArraySetAsSeries(SellBuffer,false);
   ArraySetAsSeries(open,false);
   ArraySetAsSeries(high,false);
   ArraySetAsSeries(low,false);


That is working perfectly....

Say I'm in the Daily-chart then this is the data for the Daily. In this case I also want to work with the complete dataset from the eg. H1 or M5-charts. How can I get this data in ones into my Indicator?

Thanks.

avatar
12985
WHRoeder 2016.04.09 16:39 #
 
bertje: I also want to work with the complete dataset from the eg. H1 or M5-charts. How can I get this data in ones into my Indicator?

  1. Timeseries and Indicators Access - MQL4 Reference
  2. ArrayCopyRates - Array Functions - MQL4 Reference
Note that these are all time series. Don't set your buffers to false. Don't use the variables, use the Predefined Variables - MQL4 Reference

avatar
9
bertje 2016.04.11 09:48 #
 

Thanks,

You said, don't set your buffers to false. Why? I set them to false because I needed this to invert the order of the rates...

In the manual I only can destilate that it just change the indexing.



avatar
Moderator
3206
angevoyageur 2016.04.11 12:37 #
 
bertje:

Thanks,

You said, don't set your buffers to false. Why? I set them to false because I needed this to invert the order of the rates...

In the manual I only can destilate that it just change the indexing.



You can set your buffers "to false". You have to pay attention to your indexing, don't mix "as series" and "not as series".

Usually it's simpler to use buffers as series ("to true"), but it depends of your needs.

avatar
9
bertje 2016.04.12 10:53 #
 

Thanks....

Am I right that I can't use the Arrayfunctions as ArrayBSearch, ArrayMaximum, if I use buffers NOT as series ("to false")?


avatar
Moderator
3206
angevoyageur 2016.04.12 11:15 #
 
bertje:

Thanks....

Am I right that I can't use the Arrayfunctions as ArrayBSearch, ArrayMaximum, if I use buffers NOT as series ("to false")?


Of course.
avatar
9
bertje 2016.04.12 11:20 #
 
Thanks!
Back to topics list  

To add comments, please log in or register