double price4 = (price4 + price3)/i;
You are adding 2 prices together, then dividing by the bar shift. That is not an average
GumRai:
You are adding 2 prices together, then dividing by the bar shift. That is not an average
thanks!! just realised that.
is it a better idea to use iMA to draw a graph of average price difference or doing it manually is better?
double price1 = iClose(Symbol(),0,i); double price2 = iClose(Symbol1,0,i);You can't do that in the tester. The Symbol() pair is adjusted Bar zero is the current tester bar. But OTHER pairs are not shifted in the tester.
double price1 = iClose(Symbol(),0,i); double price2 = iClose(Symbol1,0,iBarShift(Symbol1,0,Time[i]);Also make sure you have bars in chart set high enough to get the symbol1 data.
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
hi everyone i am new to custom indicator scripting, so i made a custom indicator that shows the difference in price on a graph in a separated window and i also plan to do add another one that shows the average price difference in the same window
The first graph (price difference) i drew was okay, however once i add in the average graph it messes up the whole thing and the graph just looks strange.