James3567: Can someone inform me of what I am doing wrong here?
Click on the error message and the editor will scroll to the line in error. It's not in the code you posted.
whroeder1:
Click on the error message and the editor will scroll to the line in error. It's not in the code you posted.
Click on the error message and the editor will scroll to the line in error. It's not in the code you posted.
public: /* Custom methods */ virtual double _ObjText_() { ObjText.Value = v::candle_body; return ObjText._execute_(); }MetaEditor found an error with the line in the above code --> ObjText.Value = v::candle_body;
The error message is 'candle_body' - struct member undefined
Any idea what is causing the issue?
I was able to figure it out. For anyone interested in doing this here is the code I used to calculate the average High/Low range of previous candles defined by the variable num_quiet_bars
ArrayResize(candle_body,num_quiet_bars); for (int i = 0; i < num_quiet_bars; i++) { candle_body[i] = (iHigh(_Symbol,_Period,i) - iLow(_Symbol,_Period,i))*10000; body = candle_body[i]; } int ArrayIndex; double ArraySum; for (ArrayIndex = ArraySize(candle_body) - 1; ArrayIndex >= 0; ArrayIndex--) {ArraySum += candle_body[ArrayIndex];} avg_candle_size = ArraySum/ArraySize(candle_body);
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
I've been attempting to average the High/Low range for a predefined number of previous price bars but cannot even get the array to compile without the error "struct member undefined"
Can someone inform me of what I am doing wrong here?
I would like to obtain the average for all of the values in the array "candle_body[]" but cannot even get past this part.