Created
December 21, 2020 07:57
-
-
Save sin32775/602401b5ca32eb988a5d2af3fea31cd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[]) | |
{ | |
//--- | |
if(BarsCalculated(hMA)<rates_total) | |
return(0); | |
int to_copy; | |
to_copy=rates_total-prev_calculated; | |
if(to_copy==0) | |
to_copy++; | |
if(CopyBuffer(hMA,0,0,to_copy,MABuffer)<=0) | |
return(0); | |
// Print(rates_total,",",prev_calculated); | |
//--- return value of prev_calculated for next call | |
return(rates_total); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment