try:
//if(counted_bars>0)
//counted_bars--;
limit=Bars-counted_bars+1;
note maybe: Volume[i]) =0;
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
Can anybody help me with my code?
On the last candel he draws the up-infinity line and I don't know how to fix it.
Code:
#property indicator_separate_window
//#property indicator_minimum 50
//#property indicator_maximum 50
#property indicator_buffers 1
double Buffer1[];
//--------------------------------------------------------------------
int init()
{
SetIndexStyle (0,DRAW_LINE);
SetIndexBuffer(0,Buffer1);
return(0);
}
//--------------------------------------------------------------------
int start()
{
int counted_bars=IndicatorCounted(),
limit;
if(counted_bars>0)
counted_bars--;
limit=Bars-counted_bars;
for(int i=0;i<limit;i++)
{
Buffer1[i]=(((((High[i] + Low[i])/2)-((High[i-1] + Low[i-1])/2))*(High[i] + Low[i]))/Volume[i])*1000000;
}
return(0);
}
//--------------------------------------------------------------------