Hi everybody,
I'm trying to get the value from the "average angle" indicator. But the value of the indicator displayed on the chart is different from the value of the indicator taken from iCustom. I am very confused with this problem
Please help me fix my code. Thanks in advance.
instead of placing the indicator separately onto the chart, do it from the EA after creating the handle.
the inputs of that indicator are using non-standard enumerations so it is likely an issue with the way you are setting the inputs, this avoids that and will match but you still need to ensure you are getting the inputed values that you have specified - check the enumerations...
also set the array as series in Oninit not every tick.
ChartIndicatorAdd(0,1,Handle_of_Angle);
Hi everybody,
I'm trying to get the value from the "average angle" indicator. But the value of the indicator displayed on the chart is different from the value of the indicator taken from iCustom. I am very confused with this problem
Please help me fix my code. Thanks in advance.
All working just fine :
input int MAPeriod = 34; // MA period enum enumAveragesType { avgSma, // Simple moving average avgEma, // Exponential moving average avgDsema, // Double smoothed EMA avgDema, // Double EMA avgTema, // Tripple EMA avgSmma, // Smoothed MA avgLwma, // Linear weighted MA avgPwma, // Parabolic weighted MA avgAlex, // Alexander MA avgHull, // Hull MA avgTma, // Triangular MA avgSine, // Sine weighted MA avgLsma, // Linear regression value avgIe2, // IE/2 avgNlma, // Non lag MA avgZlma, // Zeo lag EMA avgLead // Leader EMA }; input enumAveragesType MAType = avgNlma; // Calculation type enum enPrices { pr_close, // Close pr_open, // Open pr_high, // High pr_low, // Low pr_median, // Median pr_typical, // Typical pr_weighted // Weighted }; input enPrices MAPrice = pr_close; // Price to use input int AngleBars = 6; // Bars for angle input double AngleLevel = 8; // Level // // // int _handle; int OnInit() { _handle = iCustom(_Symbol,_Period,"angle_of_averages",MAPeriod,MAType,MAPrice,AngleBars,AngleLevel); if (_handle==INVALID_HANDLE) { Print("Error loading indicator"); return(INIT_FAILED); } return(INIT_SUCCEEDED); } void OnDeinit(const int reason) {} void OnTick() { double _result[]; if (CopyBuffer(_handle,0,0,10,_result)==10) { string _comment = (string)TimeLocal()+"\n\n"; for (int i=0; i<10; i++) _comment += StringFormat(" bar : %i value : %s\n",9-i,DoubleToString(_result[i],_Digits)); Comment(_comment); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi everybody,
I'm trying to get the value from the "average angle" indicator. But the value of the indicator displayed on the chart is different from the value of the indicator taken from iCustom. I am very confused with this problem
Please help me fix my code. Thanks in advance.