Created
December 21, 2020 12:17
-
-
Save sin32775/8c6e5d6ba31575d8d4ea65384d6cb0c9 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(hRSI)<rates_total && BarsCalculated(hRSIMA)<rates_total) | |
return(0); | |
int to_copy; | |
to_copy=rates_total-prev_calculated; | |
if(to_copy==0) | |
to_copy++; | |
if(CopyBuffer(hRSI,0,0,to_copy,RSI_Buffer)<=0) | |
return(0); | |
if(CopyBuffer(hRSIMA,0,0,to_copy,MA_Buffer)<=0) | |
return (0); | |
//--- 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