Commit ffee5ceb authored by FXcoder's avatar FXcoder

fix standard functions

parent b3f553cc
......@@ -57,17 +57,17 @@ int OnCalculate(const int rates_total, const int prev_calculated, const datetime
double dAPrice, dAmount, dMovingAverage;
//---- insufficient data
if (Bars <= ExtStdDevPeriod)
if (rates_total <= ExtStdDevPeriod)
return(0);
//---- bars count that does not changed after last indicator launch.
nCountedBars = IndicatorCounted();
nCountedBars = prev_calculated;
//----Standard Deviation calculation
i = Bars - ExtStdDevPeriod - 1;
i = rates_total - ExtStdDevPeriod - 1;
if (nCountedBars > ExtStdDevPeriod)
i = Bars - nCountedBars;
i = rates_total - nCountedBars;
while (i >= 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment