You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Although you published TMA_Extreme_line_indicator some time ago, I have just discovered it... And I love it !!!
I am trying to use it to automate some operations, using iCustom to fill an array and get the values of the middle line into some variables.
However, I am not able to get the values of the middle line in mode "redraw INPUT_YES". I can only get the values of the "redraw INPUT_NO", even when I represent the indicator in INPUT_YES.
This is the code I am using:
enum ENUM_INPUT_YES_NO
{
INPUT_YES = 1, // Yes
INPUT_NO = 0 // No
};
input TMAPeriods = 20
input TMA_ATRPeriods = 20
input TMA_ATRWidth = 3
input ENUM_INPUT_YES_NO InpRedraw = INPUT_YES; // Redraw
double TMA[];
int TMAControlPanel;
double TMA_1, TMA_2, TMA_3;
int OnInit()
{
ArraySetAsSeries(SlowTMADATA,true);
TMAControlPanel = iCustom(_Symbol, PERIOD_CURRENT, "TMA_Extreme_line_indicator", TMAPeriods, TMA_ATRPeriods, TMA_ATRWidth, INPUT_YES);
}
void OnDeinit(const int reason)
{
IndicatorRelease(TMAControlPanel);
}
void OnTick()
{
CopyBuffer(TMAControlPanel, 0, 0, 5, TMADATA);
TMA_1 = NormalizeDouble(TMADATA[1],6);
TMA_2 = NormalizeDouble(TMADATA[2],6);
TMA_3 = NormalizeDouble(TMADATA[3],6);
}
Would you be so kind to let me know if I am missing something in the code to be able to get to fill the variables TMA_1, TMA_2 & TMA_3 with the "redraw INPUT_YES" values?
Or , Would it be possible to get the indicator re-written so that these values become accessible?
Many thanks.
}
void OnTick()
{
CopyBuffer(TMAControlPanel, 0, 0, 5, TMADATA);
TMA_1 = NormalizeDouble(TMADATA[1],6);
TMA_2 = NormalizeDouble(TMADATA[2],6);
TMA_3 = NormalizeDouble(TMADATA[3],6);
}
Would you be so kind to let me know if I am missing something in the code to be able to get to fill the variables TMA_1, TMA_2 & TMA_3 with the "redraw INPUT_YES" values?
Or , Would it be possible to get the indicator re-written so that these values become accessible?
Many thanks.
When using this indicator with Redraw set to YES, its draws the lines beatifully. But I'm writing an EA and CopyBuffer() always returns the values as if it is set to Redraw NO.
Has anyone else had this problem.?
Cheers Pete
INPUT_YES = 1, // Yes
INPUT_NO = 0 // No
I have been looking at this beautiful channel indicator for a long time. It was amazing how it detects the channel. I looked at the code - oops. The indicator counts only on historical data, but if there is a possibility, it looks forward to the size of the TMA. Wow, what a move :)))